Fix error Depends libmysqlclient18 if mariadb is installed
I have some servers on Debian Jessie with several PHP versions. Several end customer web application are not compatible with PHP 5.6 and 7. X (damned).
My very very very old web app use “Magic quotes” for example, but this functionality was removed since the version 5.4, so I can’t use the default Debian Jessie PHP version (5.6).
I need to install PHP version 5.3 (yes, I know, it’s a very bad idea, for security issue, I know, and that’s why I want to isolate them);
Specification of my server :
- Debian 8 (Jessie)
- Nginx from official Nginx repository
- MariaDB from official MariaDB repository
- ISPconfig (because non sysadmin need to create/delete website/database/etc…)
For installing PHP 5.3.29 from source, it’s recommended to install, first, php5 dependency with the command :
root@webserver:/usr/local/src/php-5.3.29# apt-get build-dep php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have unmet dependencies:
libmysqlclient-dev : Depends: libmysqlclient18 (= 5.5.57-0+deb8u1) but 10.1.26+maria-1~jessie is to be installed
E: Build-dependencies for php5 could not be satisfied.
I try a lot of solutions available in google, but finally it’s very easy to fix this error. You just have to install the package libmariadbclient-dev
root@webserver:/usr/local/src/php-5.3.29# apt-get install libmariadbclient-dev
This trick corrected successfully the error message with the php5 dependencies, But did not allow me to install properly the PHP 5.3.29 version, because, the package is too old to support MariaDB library.
For your information, I have finally installed a new server with mysql server and not MariaDB server, and I have installed successfully PHP 5.3 from source.