Pages

PHP5 + Apache2.2 + MySQL5 Installation issue solved

I have tried many ways to get this working.

When install PHP5 + Apache2.2 + MySQL5, it shows that MySQL extension can not be loaded.

I followed every instruction to enable the extension in PHP.ini and point the Extension_dir to the right directory (ex. C:\PHP\ext). I also add the right model in Apache2.2 conf file to load the PHP5.

Problem:
PHP5 is unable to find the libmysql.dll and related MySQL extension. According to new PHP5 installation manual, you simply add your PHP5 installation path to the windows environment variables. Even you add your PHP5 installation path to the windows PATH environment variable, it still doesn't work.

Solution 1:
Copy libmysql.dll to your Windows System32 folder and restart your Apache2.2.

Warnning: This is not an ideal ways to solve the issues. You will run into situation that you need copy more dll to System32 folder. It is a night maire to upgrade the future versioin of PHP.

Solution 2:
After you set the PATH environment and restart your computer, it should just work without copying files to System32 folder. This is the reason, why it doesn't work.

Apache does not update the PATH environment until you reboot the server.
After you set the PATH environment variable, turn PHPINFO() and see if the Apache Environment variable is updated with the new path variable. If not, you will need to reboot the machine.

Problem solved! It's as simple as rebooting the machine.

No comments:

Post a Comment

Thank you for your feedback. If you find the tip and trick useful, feel free to share with your friends on Facebook, Twitter and G+!