PHP 5 and Mysql Support

Caporegime
Joined
18 Oct 2002
Posts
33,438
Location
West Yorks
Hi guys

im really banging my head over this one. I know PHP5 doesnt support Mysql by default

so ive set the extensions directory in the php.ini file, ive un-commented and enabled the php_mysql.dll line in the php.ini file

ive verified that the php_mysql.dll file is in the present, and ive also copied the libmysql.dll file into the windows\system32 directory

ive even followed the manual and added c:\php into the windows path setting so that windows can access the file from c:\php as well as c:\windows\system32

but mysql isnt loading into php. No matter where the libmysql.dll is located

anybody got any ideas ?

its on Server 2003 with IIS6, PHP 5.1.6 and MYSQL 5

but when i run the phpinfo call, the printout in no way mentions mysql extension being loaded

what have i missed ?
 
Two things to check:

You've restarted IIS (I asume you have to, only ever used PHP with Apache)?
The PHP extension directory is set correctly in php.ini? Post what you've set it to here, I had trouble getting it to work and had to use an absolute location.

Simple things so please don't be offended but worth checking.

null :)
 
ive even followed the manual and added c:\php into the windows path setting so that windows can access the file from c:\php as well as c:\windows\system32

After banging my head on the same thing, i found out that a simple reboot of the server after adding the path commands fixed it. I did try restarting IIS through services also but it had no effect.
 
Toytown said:
After banging my head on the same thing, i found out that a simple reboot of the server after adding the path commands fixed it. I did try restarting IIS through services also but it had no effect.
That prompted me to check the correct location. C:\Windows\System32 is not correct (not what I do anyway, and my way has always worked for me). I just put it in C:\Windows. Also I prefer not having to reboot so avoid the PATH option.

So yeah, just copy libmysql.dll to C:\Windows, restart IIS and it should all be working? Unless of course you have already tried putting it in C:\Windows.

Hope this helps, null :)
 
There is a 'bug' in windows php version that requires the mysql dll's to be on the path so either move the files to a path directory or add your ext dir to the path :)

And full restart of webserver is needed. start > run > iisreset should do it.
 
Dj_Jestar said:
There is a 'bug' in windows php version that requires the mysql dll's to be on the path so either move the files to a path directory or add your ext dir to the path :)

And full restart of webserver is needed. start > run > iisreset should do it.

I was trying to get this set up as well a couple of days ago and it took me ages! And this was my problem :(
 
null said:
Two things to check:

You've restarted IIS (I asume you have to, only ever used PHP with Apache)?
The PHP extension directory is set correctly in php.ini? Post what you've set it to here, I had trouble getting it to work and had to use an absolute location.

the line as written in my php.ini

extension_dir = "C:\php\ext"

Toytown said:
After banging my head on the same thing, i found out that a simple reboot of the server after adding the path commands fixed it. I did try restarting IIS through services also but it had no effect.

i've rebooted the box and re-started IIS more times than i'd care to mention

null said:
That prompted me to check the correct location. C:\Windows\System32 is not correct (not what I do anyway, and my way has always worked for me). I just put it in C:\Windows. Also I prefer not having to reboot so avoid the PATH option.

i've put the libmysql.dll in \windwos, \windows\system32 and \php still no luck with either

Dj_Jestar said:
There is a 'bug' in windows php version that requires the mysql dll's to be on the path so either move the files to a path directory or add your ext dir to the path :)

And full restart of webserver is needed. start > run > iisreset should do it.

libmysql is already in C:\PHP. and C:\PHP is in the path setting

i've also coped php_mysql.dll to C:\PHP as well as C:\PHP\EXT just to make sure and that doesnt work either

and just for good measure i added C:\PHP\EXT to the path directory as well as C:\PHP. Stil no joy

is there any way of seeing why PHP wont load the SQL plugin. a log file for PHP somewhere ?
 
Last edited:
no mention of SQL in the IIS logs

sounds like its not even attempting to load it ..

btw i'ved used the ISAPI version of php

could this be the reason ?
 
Last edited:
interesting

i changed the exensions directory to just \ext

and i now get an error message i didnt before

i now get

"PHP Warning: PHP Startup: Unable to load dynamic library '\ext\php_mysql.dll' - The specified module could not be found. in Unknown on line "


so it can find php_mysql.dll

so this means 1 of 2 things

the problem lies with the php_mysql.dll file itself

or the libmysql.dll file. But ive tyred putting that in so many directories and none of them seem to make any difference.
 
deleted the entre PHP directory

started afresh

worked fine

think the php_mysql.dll file i had was a wrong version or knackered or something
 
Back
Top Bottom