MySQL 4.0, PHP 5.3 and Server 2008

apache-2.2MySQLPHPwindows-server-2008

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.

Best Answer

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

Related Topic