No MySQL drivers for PHP 5.2 and MySQL 5.7

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Having just updated a few servers to MySQL 5.7 I realise that there are no longer any MySQL drivers for PHP version 5.2. is this the end of the line now or is there something we can do to resolve it? We have a small number of customers that still need PHP 5.2 in the short term.
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Just to clarify, during the MySQL upgrade from 5.6 to 5.7, there is always an error stating that the .so for PHP 5.2 is missing and it suggests you install ea-php52-php-mysql5.7.x86_64

ERROR : mysql.so is not found. Please install ea-php52-mysql5.7 package
ERROR : mysql.so is not found. Please install ea-php52-mysql5.7 package
ERROR : alt-ea-php52 reconfiguration is failed

So I rerun EA4 and install ea-php52-mysql5.7

I notice that there are no available MySQL extensions in EA4 for PHP 5.2

If I run /usr/local/bin/ea-php52 -m|grep mysql I get...

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

Is there a way around this issue?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
We have no supported packages for PHP 5.2 - this version of PHP has been removed for some time and deprecated for a very long time. We do have deprecated versions of PHP available on our mirrors but they are limited to PHP 5.4, 5.5, 5.6 and 7.0 This is detailed in our documentation here: EasyApache 4 FAQ - EasyApache 4 - cPanel Documentation
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
We have no supported packages for PHP 5.2 - this version of PHP has been removed for some time and deprecated for a very long time. We do have deprecated versions of PHP available on our mirrors but they are limited to PHP 5.4, 5.5, 5.6 and 7.0 This is detailed in our documentation here: EasyApache 4 FAQ - EasyApache 4 - cPanel Documentation
I'd accept your response if it were true - but PHP version 5.2 is available in EA4 so it hasn't been removed. You've only very recently removed mysql support for 5.2 because it was all working fine before we updated to 5.7 recently. This does only affect a small number of customers who need to run scripts based on PHP version 5.2 - but if 5.2 is available in EA4, you should at least support mysql, otherwise there is little point in offering that version at all.

Can you tell me where in your EA4 changelog the removal of the MySQL extensions are listed?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hello,


I'm not sure what you're seeing but PHP 5.2 is absolutely not available on EasyApache 4 on my test system:

easyapache4_php52.png

I'm also unable to query anything PHP 5.2 related from the repository:

Code:
[[email protected] ~]# rpm -qa |grep ea-php52
[[email protected] ~]#
We've never supported PHP 5.2 with EasyApache 4, we started with support for PHP 5.4 - there aren't any PHP 5.2 packages present on our GitHub either cPanel, L.L.C.

In fact, we dropped PHP 5.2 in February of 2014 in EasyApache 3.24.11 far before EasyApache 4 was ever released:

  • Implemented case 73225: Remove PHP version 5.2 and Microsoft FrontPage (mod_frontpage) from EasyApache. They are now available as Custom Modules.
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Hello,


I'm not sure what you're seeing but PHP 5.2 is absolutely not available on EasyApache 4 on my test system:

View attachment 61601
In EA4 for me on all servers including new servers that have simply had Cloudlinux and cpanel installed, If I launch EA4 and load any profile I can select PHP versions from version 5.1 up to 7.3.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
CloudLinux's PHP Selector supports more versions of PHP than cPanel does. These are all still available and recognizable as alt-php52:

Code:
[[email protected] ~]# rpm -qa |grep alt-php52
alt-php52-percona5.7-5.2.17-20.el7.x86_64
alt-php52-common-5.2.17-156.el7.x86_64
alt-php52-5.2.17-156.el7.x86_64
alt-php52-suhosin-0.9.31-3.2.el7.x86_64
alt-php52-soap-5.2.17-156.el7.x86_64
alt-php52-mariadb102-5.2.17-24.el7.x86_64
alt-php52-ioncube-loader4-4.7.5-1.el7.cloudlinux.x86_64
alt-php52-xmlrpc-5.2.17-156.el7.x86_64
alt-php52-magickwand-1.0.9-3.el7.x86_64
alt-php52-percona5.5-5.2.17-10.el7.x86_64
alt-php52-sybase-5.2.17-156.el7.x86_64
alt-php52-snmp-5.2.17-156.el7.x86_64
alt-php52-mysql5.6-5.2.17-8.el7.x86_64
alt-php52-odbc-5.2.17-156.el7.x86_64
alt-php52-gd-5.2.17-156.el7.x86_64
alt-php52-cli-5.2.17-156.el7.x86_64
alt-php52-ioncube-loader-10.3.7-3.el7.x86_64
alt-php52-ldap-5.2.17-156.el7.x86_64
alt-php52-mariadb101-5.2.17-1.el7.x86_64
alt-php52-bcmath-5.2.17-156.el7.x86_64
alt-php52-pear-1.9.5-3.el7.noarch
alt-php52-mysql8.0-5.2.17-28.el7.x86_64
alt-php52-percona5.6-5.2.17-11.el7.x86_64
alt-php52-mbstring-5.2.17-156.el7.x86_64
alt-php52-mcrypt-5.2.17-156.el7.x86_64
alt-php52-enchant-5.2.17-156.el7.x86_64
alt-php52-imap-5.2.17-156.el7.x86_64
alt-php52-pspell-5.2.17-156.el7.x86_64
alt-php52-dba-5.2.17-156.el7.x86_64
alt-php52-mysql5.5-5.2.17-17.el7.x86_64
alt-php52-mysql5.0-5.2.17-17.el7.x86_64
alt-php52-pgsql-5.2.17-156.el7.x86_64
alt-php52-mssql-5.2.17-156.el7.x86_64
alt-php52-devel-5.2.17-156.el7.x86_64
alt-php52-tidy-5.2.17-156.el7.x86_64
alt-php52-zend-optimizer-3.3.9-6.el7.x86_64
alt-php52-pdo-5.2.17-156.el7.x86_64
alt-php52-ncurses-5.2.17-156.el7.x86_64
alt-php52-sourceguardian-11.3.2-1.el7.x86_64
alt-php52-eaccelerator-0.9.6.1-62.el7.x86_64
alt-php52-mariadb10-5.2.17-6.el7.x86_64
alt-php52-recode-5.2.17-156.el7.x86_64
alt-php52-pecl-ext-1-110.el7.x86_64
alt-php52-mysql-meta-2-5.el7.x86_64
alt-php52-process-5.2.17-156.el7.x86_64
alt-php52-mysql5.7-5.2.17-25.el7.x86_64
alt-php52-intl-5.2.17-156.el7.x86_64
alt-php52-dbx-5.2.17-156.el7.x86_64
alt-php52-xml-5.2.17-156.el7.x86_64
alt-php52-mariadb103-5.2.17-27.el7.x86_64
alt-php52-xcache_3-admin-3.2.0-1.el7.x86_64
alt-php52-xcache_3-3.2.0-1.el7.x86_64
alt-php52-sqlite-5.2.17-156.el7.x86_64
alt-php52-mysql5.1-5.2.17-17.el7.x86_64
alt-php52-firebird-5.2.17-156.el7.x86_64
For MySQL specifically:

Code:
[[email protected] ~]# rpm -qa |grep alt-php52-mysql
alt-php52-mysql5.6-5.2.17-8.el7.x86_64
alt-php52-mysql8.0-5.2.17-28.el7.x86_64
alt-php52-mysql5.5-5.2.17-17.el7.x86_64
alt-php52-mysql5.0-5.2.17-17.el7.x86_64
alt-php52-mysql-meta-2-5.el7.x86_64
alt-php52-mysql5.7-5.2.17-25.el7.x86_64
alt-php52-mysql5.1-5.2.17-17.el7.x86_64
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Maybe, but we haven't got alt-php installed and we don't use cl selector - we are using only EA packages - which I thought were from cpanel.

It seems that Cloudlinux have made these packages available without telling you about it - when I list installed packages they are all there...

ea-php52.x86_64 1:5.2.17-1.el6.cloudlinux @cl-ea4
ea-php52-libc-client.x86_64 1:2007f-14.el6.cloudlinux @cl-ea4
ea-php52-pear.noarch 1:1.9.5-3.el6.cloudlinux @cl-ea4
ea-php52-php-bcmath.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-bz2.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-cli.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-common.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-curl.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-devel.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-exif.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-fileinfo.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-ftp.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-gd.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-gettext.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-iconv.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-imap.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-intl.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-ioncube.x86_64 1:4.7.5-1.el6.cloudlinux @cl-ea4
ea-php52-php-litespeed.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mbstring.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mcrypt.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mysql5.7.x86_64 1:5.2.17-2.el6.cloudlinux @cl-ea4
ea-php52-php-pdo.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-posix.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-pspell.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-soap.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-tidy.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-xml.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-xmlrpc.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-zip.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-runtime.x86_64 1:5.2.17-1.el6.cloudlinux @cl-ea4

These present themselves in EA4 as standard, seamlessley - it is important to note that we didn't do anything to make this happen apart from install CloudLinux and cpanel so it looks to me as though when we use cpanel with CloudLinux - they essentially reconfigure the system to use their EA packages and not yours. Were you aware of this?

Needless to say, ea-php52-php-mysql5.7.x86_64 doesn't seem to do anything - which puts me back to the start. Perhaps I should be seeking support from CloudLinux?
 

CloudLinux Skhristich

Well-Known Member
Verifed Vendor
May 23, 2019
62
31
18
kiev
cPanel Access Level
Root Administrator
Maybe, but we haven't got alt-php installed and we don't use cl selector - we are using only EA packages - which I thought were from cpanel.

It seems that Cloudlinux have made these packages available without telling you about it - when I list installed packages they are all there...

ea-php52.x86_64 1:5.2.17-1.el6.cloudlinux @cl-ea4
ea-php52-libc-client.x86_64 1:2007f-14.el6.cloudlinux @cl-ea4
ea-php52-pear.noarch 1:1.9.5-3.el6.cloudlinux @cl-ea4
ea-php52-php-bcmath.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-bz2.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-cli.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-common.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-curl.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-devel.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-exif.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-fileinfo.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-ftp.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-gd.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-gettext.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-iconv.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-imap.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-intl.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-ioncube.x86_64 1:4.7.5-1.el6.cloudlinux @cl-ea4
ea-php52-php-litespeed.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mbstring.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mcrypt.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-mysql5.7.x86_64 1:5.2.17-2.el6.cloudlinux @cl-ea4
ea-php52-php-pdo.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-posix.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-pspell.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-soap.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-tidy.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-xml.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-xmlrpc.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-php-zip.x86_64 1:5.2.17-27.el6.cloudlinux.19 @cl-ea4
ea-php52-runtime.x86_64 1:5.2.17-1.el6.cloudlinux @cl-ea4

These present themselves in EA4 as standard, seamlessley - it is important to note that we didn't do anything to make this happen apart from install CloudLinux and cpanel so it looks to me as though when we use cpanel with CloudLinux - they essentially reconfigure the system to use their EA packages and not yours. Were you aware of this?

Needless to say, ea-php52-php-mysql5.7.x86_64 doesn't seem to do anything - which puts me back to the start. Perhaps I should be seeking support from CloudLinux?
Hello! Can you open a support ticket https://cloudlinux.zendesk.com/hc/en-us/requests/new so we can take a closer look at your system? You can post the ticket number here and we'll link this thread to it. Thank you.
Regards,
Sergey Khristich
Marketing coordinator CloudLinux
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Hello! Can you open a support ticket https://cloudlinux.zendesk.com/hc/en-us/requests/new so we can take a closer look at your system? You can post the ticket number here and we'll link this thread to it. Thank you.
Regards,
Sergey Khristich
Marketing coordinator CloudLinux
Not really no. I can reproduce this issue on over 50 servers, including brand new ones that have only had CL and cPanel installed - so it isn't something within our servers that you need to look into. You should take a closer look at your own system.

Here is an example - brand new server with only CL and cpanel installed - I open EA4 and I can see a bunch of example profiles - all of them say "Cloudlinux" inside a little blue tag. There are no other profiles listed. If I pick any one of them and go to "customize" - every version of PHP from PHP51 to PHP73 is available to install.

What I find strange is that cpanel don't seem to know that you are replacing their EA4 profiles with your own? - or that when CL is instaleld EA4 automatically switches to using the CL repo for the packages - Is that what's happening? And if so, why don't cpanel know that? It's not a problem for me because I want to offer PHP 5.2 to a small number of customers without using ALT packages and CL Selector. This has been working great, so up til now I've been very happy.

It's just now that we've upgraded to MySQL 5.7 - during the upgrade process, as I mentioned earlier in this thread, an error occurs...


Just to clarify, during the MySQL upgrade from 5.6 to 5.7, there is always an error stating that the .so for PHP 5.2 is missing and it suggests you install ea-php52-php-mysql5.7.x86_64

ERROR : mysql.so is not found. Please install ea-php52-mysql5.7 package
ERROR : mysql.so is not found. Please install ea-php52-mysql5.7 package
ERROR : alt-ea-php52 reconfiguration is failed

So I rerun EA4 and install ea-php52-mysql5.7

I notice that there are no available MySQL extensions in EA4 for PHP 5.2

If I run /usr/local/bin/ea-php52 -m|grep mysql I get...

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so' - /opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

Is there a way around this issue?
So - while I can install 5.2 and also ea-php52-mysql5.7 - this doesn't provide any actual extensions and so there is no MySQL connectivity available for that version. I also mentioned that it was working fine with MySQL 5.6 and we haven't changed anything other than simply upgrading to MySQL 5.7 and re-running EA4 to include ea-php52-mysql5.7

I can reproduce this issue on any server with CL6 or CL7 and they are all standard stock installations.
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
931
21
168
Hello! Thank you for reaching out! You can use alt-php52 instead of ea-php52, there are these extensions. Please let us know if you have any questions. Thanks in advance!
I'd rather you got it working with the same extensions for EA4 but I suppose its a compromise.
 

smashbox

Member
Oct 24, 2015
5
4
3
Bucharest
cPanel Access Level
Root Administrator
I ran into a similar issue, but I use MariaDB. What I found is that the ea-php52 package will work, but you have to manually create symlinks. For example, it expects /opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so to be available, but if you're using something like MariaDB 10.2, then the .so is at /opt/cpanel/ea-php52/root/etc/mariadb102/mysql.so. The symlinks I had to create manually for ea-php52 (CL) to work with MariaDB 10.2 are:

Code:
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/mysql.so’
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/mysqli.so’
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/pdo_mysql.so’
Naturally your path will vary depending on the MySQL, MariaDB, or Percona package you installed. The packages available are:

Code:
ea-php52-php-mariadb10.x86_64
ea-php52-php-mariadb101.x86_64
ea-php52-php-mariadb102.x86_64
ea-php52-php-mysql5.0.x86_64
ea-php52-php-mysql5.1.x86_64
ea-php52-php-mysql5.5.x86_64
ea-php52-php-mysql5.6.x86_64
ea-php52-php-mysql5.7.x86_64
ea-php52-php-percona5.5.x86_64
ea-php52-php-percona5.6.x86_64
ea-php52-php-percona5.7.x86_64
To find the .so's in question, just list the files in the RPM you have installed, link accordingly to '/opt/cpanel/ea-php52/root/usr/lib64/php/modules/', and update cagefs if you use it - which you should be :). For example:

Code:
# rpm -ql ea-php52-php-mariadb102|grep \.so$
/opt/cpanel/ea-php52/root/etc/mariadb102/mysql.so
/opt/cpanel/ea-php52/root/etc/mariadb102/mysqli.so
/opt/cpanel/ea-php52/root/etc/mariadb102/pdo_mysql.so
# rpm -ql ea-php52-php-mariadb102|grep \.so$|xargs -i -n1 ln -sv {} /opt/cpanel/ea-php52/root/usr/lib64/php/modules/
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysql.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/mysql.so’
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/mysqli.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/mysqli.so’
‘/opt/cpanel/ea-php52/root/usr/lib64/php/modules/pdo_mysql.so’ -> ‘/opt/cpanel/ea-php52/root/etc/mariadb102/pdo_mysql.so’
# cagefsctl --update
[...]
 
Last edited: