> the protogenLabs notebook » reading full entry…
24
Fixing a php.ini configuration file problem
» posted 1290 days ago @ 07:41 PM by George Merlocco in web
> Leave a comment? [11] article comments…
I installed php with ISAPI in Windows Server 2008.
It went so bad that there was 404 error if the PATH was set in Environmental Variables. PHP worked fine when C:\PHP was removed from the PATH variable.
I put php.ini in C:\windows and it worked well. But still I can’t change the “Configuration File (php.ini) Path”
by d_shre on 02.12.2010 @ 02:50 AM » #
Hmm same problem here but with Windows 7, can’t load the extension=php_mysql.dll because the php.ini file is not being read for some reason.
Tried copying it to C:\windows as well as c:\php and no luck :(
any ideas?
by zag on 02.12.2010 @ 02:51 AM » #
Hi guys,
Thanks to the advice above, I could get my sql extension running. When you copy the php.ini file in the windows folder, make sure that the php.ini file still links to the correct extension path (in my case the absolute path is ( extension_dir = “C:\PHP\ext”)
by coco on 03.06.2010 @ 06:06 PM » #
hi i had same problem on winXP but no IIS running i think.. i copied php.ini to c:\windows and changed extension_dir path and after several apache restarts settings took and it started to work :p
by commentzor on 09.06.2010 @ 10:07 AM » #
Thanks! After looking for most of the day to troubleshoot this, I finally found this post. Even theough I copied it over to the Windows dir though, it still would not load the ini. Figured that restarting the web service from the IIS6 GUI was not doing a complete restart of the services so I finally did an IISRestart from the command prompt and voila! It sees the windows dir one but still not the one in the PHP folder…oh well at least it’s working!
by cmmitw on 11.18.2010 @ 04:38 PM » #
i had the same problem with windows 7 so i edited Apache configuration as following.
changed php dir with httpd slash ( / ) and it worked well !
PHPIniDir “C:/Program Files/php/”
hope that works well with you
by Abdullah Maswadeh on 08.28.2011 @ 04:08 PM » #
Having same problem with windows XP. using PHP Version 5.3.8….my php ini file was showing the icon of a text file, Then i come to know that it was php.ini.txt.. i renamed it with “ “ …. like “php.ini” selecting type as all files. then restarting my apache i saw the correct loaded path c:/php/php.ini…..cheers :-)
by Danyal on 08.28.2011 @ 04:44 PM » #
I have been pulling my hair out trying to get this to work. Finally someone posted the answer! I did have to reboot the server after copying the php.ini file to c:\windows, but it worked! Thanks for the post.
by SueB on 10.12.2011 @ 11:21 AM » #
I had the problem under Windows 7. It would actually find the correct php.ini when run as php.exe -i, but not using phpinfo (); through apache.
I changed PHPIniDir to use / instead of \ as suggested above and it started working.
by Doug Porter on 01.23.2012 @ 02:21 PM » #





Though not too many people run PHP on top of IIS, (it's usually Apache, or LAMP) I am one of the few who does. I recently underwent setting up a proper development environment. This of course included installing PHP 5 and MySQL 5 onto IIS7 (within Windows Web Server 2008). I followed this guide which resulted in a successful integration of PHP within IIS7. Also note that if you are installing PHP onto Windows Server 2008 or IIS7, do NOT use the "Windows Installer" to set it up. Instead, grab the .zip file of all PHP files, and run through the manual installation procedures.
Anyways, on to the actual issue that I was experiencing, which caused me to reinstall Windows and waste about 5 hours of my precious life ;) I had PHP working, but the MySQL extension was not being loaded, specifically "php_mysql.dll". I thought everything was fine and dandy because when I ran a simple PHP_info test page that contained:
< ?php phpInfo();? >I was greeted with the PHP configuration settings, however what I had failed to notice the first time was that some variables were not set correctly:
Configuration File (php.ini) Path = C:\WindowsLoaded Configuration File = (none)
It had seemed that even though I had added "C:\PHP" to my Windows Server 2008 System Variables in the PATH section, PHP was still not seeing my php.ini file which was really in C:\PHP. There was NO php.ini file in C:\Windows either. After wrestling with this for hours, I gave in and tried putting php.ini in C:\Windows, as well as having it in C:\PHP. For some unknown reason, PHP finally began to work, and I saw my php_mysql.dll file being loaded successfully. I know that this is NOT the preferred way, as you really want to keep all of your PHP files contained to the one directory, but there just wasn't a way to get this working without tearing ALL of my hair out.
If you wanted to follow up on the issue to see if the PHP team has fixed this bug, keep an eye on the official bug page. I hope this helps anyone who's run into this issue. If you have, please post your experience below, and let us know if there's anything else you've done to fix it!