|
PHP + MySQL 4.1
Date: 01/20/06
(PHP Community) Keywords: php, mysql, database, sql, web, apache
FIXED. Thanks to afromann, cowsandmilk, and nentwined!
I've been looking around since yesterday and just can't seem to find a definitive answer -- how exactly do you use MySQL 4.1.x with PHP 4.x?
Needing some of the functionality available in MySQL 4.1 (and since our host has that as well), I installed it, updated my phpMyAdmin settings, and came across "Client does not support authentication protocol requested by server; consider upgrading MySQL client" message. So I went looking for a fix for that. It told me I had to use the mysqli extension for PHP, but since I installed PHP using the installer (I am on a Windows machine, with Apache), I uninstalled PHP, downloaded the binary zip... but can't find the mysqli extension in the extensions folder in the zip.
So now I am in a quandary. The mysqli extension is not in the binary zip; is it only for PHP5? But the host we're on has MySQL 4.1.x AND PHP 4.x! The manual says something about compiling PHP with support for the mysqli extension -- do I have to recompile PHP4, is that it?
Help, advice, suggestions, etc would be very much appreciated, thanks.
Windows XP Pro Apache 1.3 (I'm using Apache 2.0 on ANOTHER machine) MySQL 4.1.16 PHP... well, none as of the moment, but I was using PHP 4.3.x; I'm trying to install 4.4.2
(Ask if there's anything else needed.)
Update: I thought it would be good to post an update since the update might be significant and people don't always check other comments. :)
Actually, I just got phpMyAdmin working -- not exactly sure what happened there, as the only thing I did was create another mysql user with access to all the databases and use that for phpMyAdmin. I thought my problem was fixed but now I'm trying to log into the webapp I'm working on, to no avail -- the script just plain dies (no warnings, errors, messages, nothing) when I call mysqli_connect( host, user, pw, database) . Echoing before and after that line--
echo 'before call'; $link = mysqli_connect( host, user, pw, database ) or die( 'Error: ' . mysqli_connect_error() ); echo 'after call';
The ONLY output is "before call". NONE of the code after the connect gets run, and obviously the die() didn't work either (or didn't output anything within the parentheses, anyway). Hence I'm a little confused why phpMyAdmin is working (without recompiling php, and without the extension dll either since I can't find it) but my script can't. I'm assuming it's BECAUSE I haven't recompiled PHP, so... yeah.
Fix: I'm not sure why phpMyAdmin can connect using php4 without having to use MySQL's old password hashing algorithm for its user, but it's probably just amazing that way. Used the OLD_PASSWORD() function to change the password for my script's user, and now it's working fine again with the ordinary mysql_* calls. :)
Crossposted: php, webdev, developers
Source: http://community.livejournal.com/php/399323.html
|