I have just had a very long frustrating experience. Most likely because I am not smart enough to understand the documentation. However Coldfusion was sooooo much easier. I was trying to follow the instructions and install PHP manually. However I tried the installer and it did not work either. PHP for Windows and MySQL. I read a lot of post on the internet about people having a problem connecting to their MySQL server from their PHP for Windows. Almost every post says you need to uncomment the MySQL dll’s in the php.ini file. Which it correct but there may be more.
This….
;extension=php_mysql.dll
;extension=php_mysqli.dll
Should look like this….
extension=php_mysql.dll
extension=php_mysqli.dll
With that out of the way I said great now it should work. NOT…I tried everything. The thing that help is what I should have done first. I made a test.php file and put these 3 lines in it and ran it.
<?php
echo phpinfo();
?>
This told me one very important thing. I am too stupid to run PHP. Nooo just kidding wellll who knows. See below these two lines tell the story.
| Configuration File (php.ini) Path | C:\WINDOWS |
| Loaded Configuration File | (none) |
See the (none) this is bad. It did tell me no matter how much I modified my php.ini file it was never going to work. For one simple reason it was not reading my php.ini file because it could not find my php.ini file. Why you ask…..
There is a system variable that needs to exist in order for it to find the php.ini.
PHPRC
So when you when you open up a command prompt and you type “set” without the quote marks and hit enter you see all your system environment variables if you do not see something like this you have a problem.
PHPRC=C:\php
C:\php would be the location of your php.ini file.
PHP looks for this system environment variable and if it does not find it does not read the php.ini file.
Here is how you fix it. Go into your control panel and click on System then click on the Advanced tab and then click on Environment Variables. Under System Variables click New under Variable Name type in “PHPRC” without the quote marks under Variable Value type in the path to you php.ini. (example c:\php) Then re-boot. That did it for me.
As always do this at your own risk. Who knows I may have missed something and I am not responsible for you messing up your system.
