1

Right off the bat I know that these two versions don't play nicely together but oddly enough XAMPP somehow allows it to happen. We have a machine running XAMPP that somehow (beyond me) allows PHP 5.3.1 to talk to a MySQL 4.0.18 database. We tried to duplicate this setup (minus XAMPP) and install the same version of Apache, MySQL and PHP on a new machine but logically we are stuck trying to get around the following error message:

Warning: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 is not supported. Server is 4.0.18-max-debug in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\nktest.php on line 3 Warning: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 servers is not supported in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\nktest.php on line 3 Failed: Connecting to 3.22, 3.23 & 4.0 servers is not supported

Unfortunately we are stuck w/ MySQL 4.0.18 because the application we are running on that box requires it and comes w/ a pre-built version. We also need to use PHP 5.3 because of another package that depends on that hence we are stuck. I have tried to figure out what XAMPP is doing behind the scenes to make all of this work but I can't seem to make sense of it.

In short, does anybody know of a way to enable connectivity to a MySQL 4.0.18 database w/ PHP 5.3.1 on a Windows Server 2008 machine? The application needs access to all standard MySQL library functions, i.e. mysql_connect() so using strictly mysqli is not an option.

1

XAMPP does some hacking that is not strictly safe to run on a web facing server to make it happen

is there any reason you cant run 2 php binaries on your system and call the older version for the site that needs the mysql4 db, is there also any reason the prebuilt version cant be upgraded or replaced? surely the app can be broken away from the DB in such a way it doesnt need its own prebuilt version?

the other option would be to put the mysql4 app on a VM on the server to run an older version of php, and then you could run latest versions of mysql and php for your other sites

  • Hence our desire to NOT use XAMPP on the production box :) -- unfortunately no we need to use 5.3 to access the DB due to the new layer we just added on and it wont work to bounce between versions of the binary. – Nicholas Kreidberg Mar 18 '11 at 20:18
0

We ended up getting this working by doing two things:

1) Compile PHP 5.3.1 on Windows w/ the --disable-mysqlnd flag 2) Omit mysqli from the compilation.

PHP 5.3.1 is now talking to MySQL 4.018, phew.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.