This is an interesting one that certainly deserves its own post here. It took me a while to find this solution. Here goes:
So you set your development environment in Windows Vista by installing apache, php, perl and mysql. You point your browser to your php script that uses mysql connection and this is what you get:
Call to undefined function mysql_connect()
What a disappointment!
Go to your php directory and open your php.ini file. If you followed my previous post about installing php, your directory should be located in C:\PHP. Here are the changes you need to make in php.ini file:
1)Set the extension directory by finding the line that starts with “extension_dir” and changing to
extension_dir = “C:\php\ext”
2)Uncomment the following line by removing “;” at the start of the line.
Restart apache and go back to your script.
There is a possibility you will get a cryptic Windows Vista Error telling you that the server stopped working and Windows Vista will inform you when a solution found. Nice!
Here is the solution when php and mysql crash apache server in Vista:
1) Go to your mysql installation directory and rename libmysql.dll to libmysql.dll.bak just in case something else goes wrong. libmysql.dll is located in BIN directory in your mysql installation directory.
2) Go to your php installation directory — C:\PHP in my case — and copy libmysql.dll located here to your-mysql-install-dir\bin where the one we renamed was.
3) Restart apache.
Hopefully your php script with mysql connection will work now.