views:

61

answers:

5

I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.

--- EDIT ---

So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.

+4  A: 

You probably need to enable the extension in your php.ini

Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.

If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.

extension=mysql.dll
Alan Geleynse
Bingo! This was exactly the problem I had the first time I tried installing PHP and MySQL on a new system.
EAMann
I can't find a list of extensions, probably because I installed php without extensions the first time. I then did a repair install to add the extensions in, however it didn't change my php.ini I'll just have to get move them over from my another ini. Thanks.
NCX001
I edited my post you suggestion should have worked but instead apache crashes every time I enable the extension.
NCX001
@NCX001: did you check the event that is generated when apache 'crashes'? What does it say?
shylent
@shylent Just that it was terminated unexpectedly.
NCX001
You said you would copy the line from another PHP installation, did you copy the extension dll from the other as well? It is possible you are using different versions of the extension and PHP. If you reinstall PHP with extensions it should match.
Alan Geleynse
@Alan copyied it over from the source file for php 5.2.14, the installer is also 5.2.14. I also did a repair install from the installer to add the extensions to make sure they were versioned correctly. I am going to try a full reinstall of PHP to try and get it to work. Hopefully that'll be the end of it.
NCX001
@NCX001: you might also be missing libmysql.dll. Try copying that file from your other installation as well. You may need to put it in your Windows system32 directory depending on your setup.
Alan Geleynse
A: 

Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it. Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:

extension_dir = "C:/php/ext"

galymzhan
Looks like you got your slashes mixed. Mine is installed in the same place, and my extension dir is set correctly. The DLLs are in the ext folder. I don't know what the problem is.
NCX001
A: 

Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.

NCX001
A: 

I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.

Horus