Jump to content

Having trouble enabling php5 to use mysql


mdzwolf

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.
Link to comment
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....
Link to comment
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.
Link to comment
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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.