php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #32576 Registry key use needs more information
Submitted: 2005-04-04 22:21 UTC Modified: 2005-04-05 15:35 UTC
From: peter dot ordal at rochester dot edu Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.0.4 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2005-04-04 22:21 UTC] peter dot ordal at rochester dot edu
Description:
------------
I read in install.txt that I could put a path for my php.ini file in HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath. This applies to PHP 5 only as I understand it.

I tried that, but PHP 5 kept accessing the php.ini in c:\winodws. It took me a while to figure out, and I had to download Filemon (www.systeminternals.com) to figure it out. It turns out that, under IIS 6 at least, whatever you put in HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath is actually appended to the web server executable root directory, and does not stand on its own (as the documentation implies). In my case, IIS looked for the ini file at C:\windows\system32\inetsrv\"C:\Program Files/php-5.0.4-Win32"\php.ini which is not valid.

I reconfigured the variable to be ../../../Program Files/php-5.0.4-Win32, and things worked. Note the exclusion of quotes is important.

Reproduce code:
---------------
Here is the context from install.txt;

Copy your chosen
   ini-file to a directory that PHP is able to find and rename it to
   php.ini. PHP searches for php.ini in the following locations (in
   order):

     * PHPIniDir directive (Apache 2 module only)
     * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath
     * The PHPRC environment variable
     * Directory of PHP (for CLI), or the web server's directory (for
       SAPI modules)
     * Windows directory (C:\windows or C:\winnt)

Expected result:
----------------
For IIS to read C:\Program Files/php-5.0.4-Win32 for my php.ini when "C:\Program Files/php-5.0.4-Win32" is in the registry.

Actual result:
--------------
IIS read the invalid path C:\windows\system32\inetsrv\"C:\Program Files/php-5.0.4-Win32"\php.ini instead.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-05 09:52 UTC] vrana@php.net
Can you please change the forward slash in "C:\Program Files/php-5.0.4-Win32" to backslash and test it?
 [2005-04-05 10:58 UTC] vrana@php.net
You can't use quotes around the value stored in IniFilePath.
 [2005-04-05 15:35 UTC] peter dot ordal at rochester dot edu
The problem was indeed the quotes. I don't play in the registry much, hence my mistake. I know I've seen them on other keys, but I guess not file paths. Also regarding the slashes, I mistyped the bug report but they were correct in the registry key.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 10:01:31 2024 UTC