Issue 1 - 09 May 2009 Go Back

My First Experience with PHP, Apache and MySQL installation

Although some people are saying that the installation is very straightforward I struggled for a few days to get all three software tools working together. First I installed MySQL Server 5.1. The only problem I had was that it did not like any locations except C:\Program Files so I had to install it there. Installation of Apache server went through smoothly with no problems. Then it was PHP turn. I installed it following the instructions to set some global variables in php.ini. First I could not see the Mysql block but after I added the following lines I got the desired result.

extension=php_mysql.dll
extension=php_mysqli.dll

I'd like to notice that many tutorial recomend to copy the libmysql.dll file into your Window's System folder (usually C:\Windows\System32\ although might be C:\WinNT\System\ ). But it's better to do it through setting of Environmental Variables. Go to your Start -> Control Panel -> System -> Advanced System Settings then to the advanced tab, Click on the Environmental Variables button, then scroll down in system variables to find PATH, Edit it Add C:\PHP; to it. Click Ok and reboot your system.

After I finished php installation I've decided to test a database connection. I just created a database, added a table and wrote a simple code to open the connection, ran it and here was the error:

Fatal error: Call to undefined function mysql_connect()

There are many topic regarding the error but none of them fixed my issue. I won't discribe here how I got the solution, but the problem was libmySQL.dll. The dll should be present in the C:\PHP, C:\Program Files\apache\bin and C:\Program Files\mysql\bin. So if you experiece the same type of error and you are unable to fix it try to check if all those folders have the latest version on libmySQL.dll. While I was dealing with the issue I downloaded the xampplite package and looking at the structure of the folders and files it led me to find the solution.

I've found the best tutorial for the installation here

 


© 2011 E-SIGHT PTY.LTD. Mentone Vic 3194 Melbourne ,                   :: Installation PHP, Apache and MySQL :: |    Home    |    Contact Us    |    Sitemap    |