I'm continuing to get this error...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

I'm continuing to get this error...

Post by erupt »

Trying to make MySQL and php 5 work together. Instead i get this error when i tried to run a simple test to see if they are working together.

I am currently running Php 5 along with MySQL server 4.1 and IIS.

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\sqltest.php on line 11

Now i know this error indicates that I don't have mysql enabled in php... but that's the thing. I configured Mysql to run by editing the php.ini file and copied all of the necessary files into the proper folders. It seems like i've done all the necessary troubleshooting to make this problem go away but to no avail. I know many people have experienced or seen people have this error before. Any help would be greatly appreciated.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

The compiled Windows binaries (what you download off php.net) no longer
have MySQL enabled by default. Instead, you need to take the following
steps during setup:

a) Enable php_mysql.dll in php.ini Be 100% certain you are editing
the proper php.ini*
b) Be sure to copy the libmySQL.dll from the dll/ folder to the
location install.txt asks you to move all dll's in dll/ to.
This is the step most miss. Essentially it needs to be available
to your systems PATH which ideally you'll edit your Windows system
PATH environment variable to include the PHP dir. Doing so would
however require a reboot of Windows but in the end is worth it as
it means all PHP files are in ONE directory so upgrades are easy.
c) Restart web server
d) Further problems? Read the manual.
* http://php.net/manual/en/install.windows.manual.php
* http://php.net/manual/en/faq.installation.php

Other notes:
-------------------
The above all refers the the ext/mysql extension in PHP 5, which works
with MySQL 3 and MySQL 4.0.x If you're interested in MySQL 4.1 and
above, you should use the ext/mysqli PHP extension instead. This topic
goes beyond the scope of this faqt.
Found that through google.
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

Tried with php 4.4.2

Post by erupt »

I download php version 4.4.2 and configured everything. I checked my phpinfo file and said mysql was enabled (it's enabled by default). But now i get this error:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\sqltest.php on line 11


What is causing this error? How do i rectify this error??[/b]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Google is your friend..

or even search these boards, as we've discussed this several times :wink:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Find "my.ini" inside windows directory and insert the following lines (First line is just a comment, it can be ommited)

#Use old password encryption method (needed for 4.0 and older clients).
old_passwords

Restart the service for the changes to take place.
Try that.

EDIT: And yes I found that through google too :idea:
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

That's why i'm on this message board

Post by erupt »

because everything i've discovered through google has not worked
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

well what have you tried?
Post Reply