tips and tricks for web developers & designers, and system & network admins

not-sexy.com

PHP on Windows not using correct php.ini file

January 8, 2008 | work, php, iis, windows | 3:25 pm | |

I just installed PHP 5 on a windows 2003 server running IIS 6 and found that none of my extentions were loading correctly. Upon further inspection of the phpinfo() command, I found the following:


Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File (none)

So PHP had decided not to use the php.ini file that was located in the working directory, but rather attempt to use one from C:\Windows, and because it could not find one there it was using the default setup. Initially I put a symlink from c:\windows\php.ini to the real php.ini file, but that did not appear to work either.

The solution is a simple registry key that was missing/not created. Simply create the following string:


HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath REG_SZ C:\path\to\php\

ie: C:\PHP5\
ie: C:\WebPlugins\PHP\

Basically the path to your php.ini file, without the actual file name on the end.

Easy as pie!


No Comments »


No comments yet.

Leave a comment

You must be logged in to post a comment.