Page 1 of 1
I'm continuing to get this error...
Posted: Sat Feb 25, 2006 11:54 am
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.
Posted: Sat Feb 25, 2006 1:23 pm
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.
Tried with php 4.4.2
Posted: Sat Feb 25, 2006 1:46 pm
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]
Posted: Sat Feb 25, 2006 1:52 pm
by John Cartwright
Google is your friend..
or even search these boards, as we've discussed this several times

Posted: Sat Feb 25, 2006 3:19 pm
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

That's why i'm on this message board
Posted: Sat Feb 25, 2006 3:43 pm
by erupt
because everything i've discovered through google has not worked
Posted: Sat Feb 25, 2006 4:12 pm
by John Cartwright
well what have you tried?