Jump to content


Photo

Having trouble enabling php5 to use mysql


  • Please log in to reply
4 replies to this topic

#1 mdzwolf

mdzwolf
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 June 2006 - 03:09 AM

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.

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 18 June 2006 - 03:15 AM

[!--quoteo(post=385228:date=Jun 17 2006, 11:09 PM:name=mdzwolf)--][div class=\'quotetop\']QUOTE(mdzwolf @ Jun 17 2006, 11:09 PM) View Post[/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....
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 mdzwolf

mdzwolf
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 June 2006 - 03:24 AM

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?

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 18 June 2006 - 09:50 PM

[!--quoteo(post=385233:date=Jun 17 2006, 11:24 PM:name=mdzwolf)--][div class=\'quotetop\']QUOTE(mdzwolf @ Jun 17 2006, 11:24 PM) View Post[/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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 radalin

radalin
  • Members
  • PipPipPip
  • Advanced Member
  • 179 posts

Posted 19 June 2006 - 08:47 AM

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 :)
Roy Simkes
Yet Another Parkyeri Developer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users