|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41408 PHPIniDir Uses Backslashes in httpd.conf so can't find php.ini
Submitted: 2007-05-16 11:54 UTC Modified: 2008-08-22 18:10 UTC
From: alison dot holloway at oracle dot com Assigned: jmertic (profile)
Status: Closed Package: Windows Installer
PHP Version: 5.2.2 OS: Windows XP SP2
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: alison dot holloway at oracle dot com
New email:
PHP Version: OS:


 [2007-05-16 11:54 UTC] alison dot holloway at oracle dot com
The httpd.conf files in Apache2 uses backslashes in the PHPIniDir parameter, so the path for php.ini is set to C:\Windows, instead of where PHP is installed. This means that no extensions or configuration changes are made. Only the default PHP settings are available.

While there are some similar bugs (Bug #39799: Windows installer does not set PHPIniDir properly), they suggest the fix is in this release, but it still doesn't work as expected, so continuing with logging this bug.

Reproduce code:
Install Apache 2.0.59 on Windows XP Pro SP2.
Install PHP 5.2.2 using .msi installer.
Create phpinfo() file and check the location of the php.ini file.
Location of php.ini is set to C:\WINDOWS.
Change following line in httpd.conf

PHPIniDir "C:\Program Files\PHP\"

Save and restart Apache.

The location of php.ini is now set correctly to C:\Program Files\PHP\php.ini.

All extensions and configuration is now correct.

Expected result:
Expected extensions to be loaded, but were not.

Actual result:
No extensions loaded.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-16 12:47 UTC]
What is the value of PHPIniDir before you make the change?
 [2007-05-16 17:17 UTC]
Try latest installer from snaps to see if it does the correct behavior.
 [2007-05-16 17:38 UTC]
Nevermind that, snaps isn't building a working installer at the moment. 

I'm going to get the installer respun for 5.2.2 here shortly.
 [2007-05-16 18:15 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2007-05-21 18:29 UTC]
Try the following "unoffical" re-spin:
 [2007-05-24 07:12 UTC] alison dot holloway at oracle dot com
I tested the new release. It works. I seem to remember reading that double back slashes are the same as a forward slash, so I'm assuming that's why it now works.

The entry in httpd.conf is now:

PHPIniDir "C:\\Program Files\\PHP\\"
LoadModule php5_module "C:\\Program Files\\PHP\\php5apache2.dll"

Although the phpinfo() displays the following output:

Configuration File (php.ini) Path 	C:\WINDOWS
Loaded Configuration File 	C:\Program Files\PHP\php.ini

For some reason the path is still showing the incorrect folder, but it is loading the correct file.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Sep 27 06:01:24 2023 UTC