I am trying to migrate an application from PHP 5.2.X to PHP 5.4.4 and I am having a few problems related to how the app connects to the database.
The new server fails on this line:
$this->db = @mysql_pconnect(_DBHOST,_DBUSER,_DBPASS);
I know that the new versions have changed the way the apps connect to the database but I have been trying to connect with other methods and I couldn’t. I think it should be related to the server configuration which can be found here: http://bit.ly/S2px7Q
What I see is that mysqlnd is installed but not the mysql, mysqli or PDO. Is that correct?
If you’re getting
Undefined Functionerrors, then it means that themysqllibrary is not installed in your copy of PHP.This may actually be a good thing, because this particular library is considered obsolete. PHP provides at least two good alternatives which are recommended to use instead.
I recommend that you switch all your
mysql_xxx()function calls for the equivalentmysqli_xxx()calls.This will allow you to start using a better library with minimal code changes. You could also use the PDO library, but that would involve more work if you’re dealing with existing code.