Jump to content

Archived

This topic is now archived and is closed to further replies.

mdzwolf

Having trouble enabling php5 to use mysql

Recommended Posts

I have installed php 5 on to my sever running IIS 6.0 and it works fine. I know that php 5 doesn't have built in support for mysql and I have followed instructions on the web to enable it but I am still having issues. When I try to load a page with the mysql_connect funtion I get:
Fatal error: Call to undefined function mysql_connect()

Here is what I have done to enable mysql support in php 5.

in php.ini - located in the c:\windows directory

extension_dir = "C:\PHP\ext" - this is the current extension directory

;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dl


I have copied php_mysql.dll and php_mysqli.dll to the c:\windows\system32 directory
I have also added c:\php and c:\php\ext to the system path as well.

I have restarted my machine and it still gives me the fatal error saying the mysql_connect funtion is undefined. Does anybody have any idea why this is still happening?

Thanks in advanced.

Share this post


Link to post
Share on other sites
[!--quoteo(post=385228:date=Jun 17 2006, 11:09 PM:name=mdzwolf)--][div class=\'quotetop\']QUOTE(mdzwolf @ Jun 17 2006, 11:09 PM) [snapback]385228[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I have installed php 5 on to my sever running IIS 6.0 and it works fine. I know that php 5 doesn't have built in support for mysql and I have followed instructions on the web to enable it but I am still having issues. When I try to load a page with the mysql_connect funtion I get:
Fatal error: Call to undefined function mysql_connect()

Here is what I have done to enable mysql support in php 5.

in php.ini - located in the c:\windows directory

extension_dir = "C:\PHP\ext" - this is the current extension directory

;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dl
I have copied php_mysql.dll and php_mysqli.dll to the c:\windows\system32 directory
I have also added c:\php and c:\php\ext to the system path as well.

I have restarted my machine and it still gives me the fatal error saying the mysql_connect funtion is undefined. Does anybody have any idea why this is still happening?

Thanks in advanced.
[/quote]
I thought you had to use the mysqli libraries....

Share this post


Link to post
Share on other sites
Well I just switch the statment to use mysqli_connect and it still gives me the same error. What do you mean by using the mysqli libraries?

Share this post


Link to post
Share on other sites
[!--quoteo(post=385233:date=Jun 17 2006, 11:24 PM:name=mdzwolf)--][div class=\'quotetop\']QUOTE(mdzwolf @ Jun 17 2006, 11:24 PM) [snapback]385233[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Well I just switch the statment to use mysqli_connect and it still gives me the same error. What do you mean by using the mysqli libraries?
[/quote]
I just mean that I was under the impression that you needed the updated mysqli libraries installed correctly for PHP5 to interface with MySQL. Again, I don't know any specifics, but it sounds like something I've heard before.

Share this post


Link to post
Share on other sites
Did you made your IIS configs? The problem in php there are lots of php.ini files :) You have to edit the right one for proper use. What you should edit is the one that IIS is using I think. If you edit that one and then try restarting your server. Or install wampserver on your machine which comes with mysql5 and php5. With some edits, you can configure it to control postgresql and other databases do (as I did :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.