medfacit
asked on
How do I change the Configuration File (php.ini) Path for PHP5?
Hi there,
I am manually installing PHP5 onto a x86 Windows 2003 box with IIS6. The version of PHP I am installing is 5.2.6. I have created a directory C:\PHP and placed PHP in this directory including the php.ini file. I have also downloaded and extracted the PECL binaries for this release.
I have added C:\PHP\ to the system's PATH variable and created a new variable called PHPRC to which it's value was set also to C:\PHP\. I have also created a registry entry at HKLM\SOFTWARE\PHP called IniFilePath and set that to C:\PHP.
Whenever I run phpinfo(), I am presented with two pieces of information. They read as follows:
Configuration File (php.ini) Path -> C:\WINDOWS
Loaded Configuration File -> C:\PHP\php.ini
Although I have the mysql extension uncommented, I seem to unable to load this extension and use it. I'm thinking it's probably because I don't have the libmysql.dll file in my C:\WINDOWS directory, but I don't want this.
Can someone please advise how I can go about changing the Configuration File (php.ini) Path from C:\WINDOWS to C:\PHP?
Many thanks...
I am manually installing PHP5 onto a x86 Windows 2003 box with IIS6. The version of PHP I am installing is 5.2.6. I have created a directory C:\PHP and placed PHP in this directory including the php.ini file. I have also downloaded and extracted the PECL binaries for this release.
I have added C:\PHP\ to the system's PATH variable and created a new variable called PHPRC to which it's value was set also to C:\PHP\. I have also created a registry entry at HKLM\SOFTWARE\PHP called IniFilePath and set that to C:\PHP.
Whenever I run phpinfo(), I am presented with two pieces of information. They read as follows:
Configuration File (php.ini) Path -> C:\WINDOWS
Loaded Configuration File -> C:\PHP\php.ini
Although I have the mysql extension uncommented, I seem to unable to load this extension and use it. I'm thinking it's probably because I don't have the libmysql.dll file in my C:\WINDOWS directory, but I don't want this.
Can someone please advise how I can go about changing the Configuration File (php.ini) Path from C:\WINDOWS to C:\PHP?
Many thanks...
ASKER
Thanks thebradnetwork.
I tried using the installer and it the configuration path still says C:\WINDOWS. Before installing PHP via the installer I manually removed C:\PGP from the path variable (to allow the installer to do it) and removed the PHPRC variable. I then tried manually reinstalling and still getting the same result.
I have even gone to the trouble of setting up a fresh new server with only IIS installed and I am still getting the same result.
I tried using the installer and it the configuration path still says C:\WINDOWS. Before installing PHP via the installer I manually removed C:\PGP from the path variable (to allow the installer to do it) and removed the PHPRC variable. I then tried manually reinstalling and still getting the same result.
I have even gone to the trouble of setting up a fresh new server with only IIS installed and I am still getting the same result.
I have attached 3 print screens on things for you to check. With the installer it will give you the option to change the install directory. By default it is in the Program Files folder...you might want to check in there to make sure you havent over looked it. Also If you go to System properties then advanced tab > enviroment variables > scrolll down in the system variables to make sure your path is pointing to the PHP directory. Next go and make sure your IIS config is similar to mine. You will find that under the properites of the website and then home directory then configuration. If this is done correctly you shouldnt have to manually install anything. The install usually (notice i said usually :) does the work. Once you are done make sure to reboot.
installdirectory.jpg
path.jpg
config.jpg
installdirectory.jpg
path.jpg
config.jpg
ASKER
Thanks thebradnetwork. Very good detailed instructions!!
Can you confirm that your Configuration File (php.ini) Path is set to C:\Program Files\PHP and that your Loaded Configuration File is C:\Program Files\PHP\php.ini? (Info available through phpinfo() )
I have already tried today the installer with no luck. I will try again though and ensure that I have the settings correct as per your screen dumps above.
Thanks.
Can you confirm that your Configuration File (php.ini) Path is set to C:\Program Files\PHP and that your Loaded Configuration File is C:\Program Files\PHP\php.ini? (Info available through phpinfo() )
I have already tried today the installer with no luck. I will try again though and ensure that I have the settings correct as per your screen dumps above.
Thanks.
ASKER
Am I right in thinking that as I am using the pre-compiled Windows binaries, PHP has already been built with the C:\WINDOWS config path and that this is not changable?
ASKER
Just finished trying again with the installer. Still doesn't appear to want to work. See attached picture.
phpinfo.jpg
phpinfo.jpg
I see what your saying now. I dont know why it displays it as C:\windows because if you do a search for the php.ini file you will see that it isn't located in there and that it is located in your C:\Program Files\PHP\php.ini. I just ran the phpinfo() on my server and it gave me the same thing. The file you need to edit is in the C:\program files\php\php.ini. Some one did report that as a bug pertaining to that...here is the link
http://bugs.php.net/bug.php?id=42849
This what I found on how to change the path
http://us3.php.net/configuration
Also you may want to change your session.save_path in the php.ini file to C:\php or whatever you would like it to be but as always make sure to backup your ini file first.
http://bugs.php.net/bug.php?id=42849
This what I found on how to change the path
http://us3.php.net/configuration
Also you may want to change your session.save_path in the php.ini file to C:\php or whatever you would like it to be but as always make sure to backup your ini file first.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The only thing I can think of is that it is showing the system variable path...but the php.ini file is not in there.
Link to the installer
http://us3.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror