|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #27316 Automatically add PHP directory to PATH
Submitted: 2004-02-18 17:26 UTC Modified: 2010-02-15 12:50 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: php at koteroff dot ru Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.0.0b4 (beta4) OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php at koteroff dot ru
New email:
PHP Version: OS:


 [2004-02-18 17:26 UTC] php at koteroff dot ru
New PHP distribution directory structure is great. Now php.exe works immediately after unpacking & modifying php.ini.

But with mod_php thinks are worse. To make him start I have to:
1. Set PHPRC environment variable equal to PHP5 directory path (to search php.ini in this directory - for example, let it be z:/usr/local/php5).
2. Manually add z:/usr/local/php5 to PATH to allow PHP search for libmysql.dll, libeay32.dll etc. while loading extensions.

It is too importunate and makes mod_php usage greatly harder than CGI version using. That's why I ask you to add the following features:

1. By default search php.ini not only in apache directory (it's silly) and in windows directory (it's silly twice - nothing personal: nobody wants to trash windows folder), but at php5apache.dll directory too.
2. Also add directory in which php5apache.dll resides to PATH (possibly at php5apache startup code).

These changes will unversalize PHP and make mod_php installation not harder than CGI installation. (I'd like to say thet a lot of people uses Windows-PHP in debugging purposes. That's why they have 2 or 3 different version of PHP at the same server.)

To get current module name, we may use GetModuleFileName API call. To set environment variable PATH GetEnvironmentVariable and SetEnvironmentVariable may be used.

Please answer what do you thing about all of these?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-18 19:27 UTC]
Php.ini issues aside, why would you want to add php folder to the path? It should work without it, at least on newer windows versions. What version of windows are you using?
 [2004-02-19 04:25 UTC] php at koteroff dot ru
I test all on Windows 98. If I do not add PHP directory to PATH before running Apache (in BAT-file, for example), while including php_mysql.dll it cannot fing libmysql.dll. I used filemon to determine where does it search for, and see that it is Apache directory and directories in PATH ? nothing else.

It can be understood: by default Windows searches for DLLs in current directory, in directory, where main exe (apache.exe) resides and in PATH. No other pathes.

Now I'm working on second edition of my book, and here is the chapter about instlalling PHP as CGI and as module. CGI installation occupies only one page, but module installation ? about 6 pages (including description of every potencial reefs). I'd like to say also that a lot of other subsystems (Perl, MySQL, Art. Lebedev's Parser, Apache itself etc.) greatly works without ANY manipulation with PATH and other environment. They are autonomous. Nowadays PHP is annoying exclusion.
 [2004-02-21 10:16 UTC] php at koteroff dot ru
If you want I can patch PHP myself and send you diff. But I want to be sure that this diff will be applied in official distribution.
 [2010-02-12 20:40 UTC] info at adora dot it
 [2010-02-15 12:50 UTC]
Installer does it.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 02:03:33 2022 UTC