Trying to make PHP 5.6 available using an EasyApache 4 custom profile, but it says it will not install unsupported packages?

Kadence

Active Member
Nov 25, 2006
32
1
158
I know that PHP 5.6 is a security risk, but I have some very old sites that use mysql_connect(), so I would like to install it on an Ubuntu machine. I'm trying to install it with an EasyApache 4 custom profile, but it says it will not install unsupported packages. What else do I need to do to get cPanel to make PHP 5.6 available, other than creating a custom EasyApache 4 profile? I am using cPanel Ubuntu 20.04.

For some background, this article says that PHP 5.6 is not available in Ubuntu:


It is installable in CentOS. However this article:


Says,
If CloudLinux is not an option for you or your customers, there is the option to create a custom EasyApache 4 profile and continue to use PHP 5.6 and 7.0, but we do not recommend it.
And links here:


That page says,
All custom profiles save to the /etc/cpanel/ea4/profiles/custom directory.
And gives this example profile file:

{
"version":"1.2",
"name":"SuperHost Profile",
"tags":[
"Apache 2.4",
"PHP 7.0",
"tomorrow comes knocking",
"..."
],
"desc":"This profile will allow you to have super high density on your system",
"pkgs":[
"ea-mod_xyz",
"ea-php70",
"ea-php71",
"ea-your_frog",
"..."
]
}
There is a file, /etc/cpanel/ea4/profiles/pkg-manifest.json. There is also a sub-folder /etc/cpanel/ea4/profiles/cpanel, which contains these files:

allphp-opcache.json
allphp.json
default-nginx.json
default.json
mpm_itk.json
nophp.json
worker.json

I made a folder, /etc/cpanel/ea4/profiles/custom, and made a file myprofile.json (based on default.json) containing:

{
"desc" : "A custom profile to add PHP 5.6 and PHP 7.0.",
"name" : "cPanel with PHP 5.6",
"pkgs" : [
"ea-apache24",
"ea-apr",
"ea-apr-util",
"ea-apache24-mod-mpm-prefork",
"ea-apache24-mod-ruid2",
"ea-apache24-mod-ssl",
"ea-apache24-mod-deflate",
"ea-apache24-mod-expires",
"ea-apache24-mod-headers",
"ea-apache24-mod-proxy",
"ea-apache24-mod-proxy-fcgi",
"ea-apache24-mod-cgi",
"ea-apache24-mod-unique-id",
"ea-apache24-mod-security2",
"ea-php56",
"ea-php70",
"ea-php81",
"ea-php81-php-bcmath",
"ea-php81-php-calendar",
"ea-php81-php-curl",
"ea-php81-php-ftp",
"ea-php81-php-gd",
"ea-php81-php-iconv",
"ea-php81-php-imap",
"ea-php81-php-mbstring",
"ea-php81-php-mysqlnd",
"ea-php81-php-pdo",
"ea-php81-php-posix",
"ea-php81-php-sockets",
"ea-php81-php-xml",
"ea-php81-runtime",
"ea-php81-php-fpm",
"ea-php81-php-zip",
"ea-php80",
"ea-php80-php-bcmath",
"ea-php80-php-calendar",
"ea-php80-php-curl",
"ea-php80-php-ftp",
"ea-php80-php-gd",
"ea-php80-php-iconv",
"ea-php80-php-imap",
"ea-php80-php-mbstring",
"ea-php80-php-mysqlnd",
"ea-php80-php-pdo",
"ea-php80-php-posix",
"ea-php80-php-sockets",
"ea-php80-php-xml",
"ea-php80-runtime",
"ea-php80-php-fpm",
"ea-php80-php-zip"
],
"tags" : [
"Apache 2.4",
"PHP 8.0",
"PHP 8.1"
],
"version" : 1
}
However, in EasyApache 4, though I can see the new profile option, it says:

This profile includes the following packages that are not supported on this server:
  • php56
  • php70
The system will not install the unsupported packages. Do you wish to continue?
And if I try to Customize the profile, PHP 5.6 and PHP 7.0 do not show up under Customize>PHP Versions.

Is there something I can to force cPanel to add these PHP versions as installable options? What other steps do I need to take to make PHP 5.6 available?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,597
2,616
363
cPanel Access Level
Root Administrator
Hey there! Unfortunately, no, there's not going to be a way to force that to work even with a custom profile. The best option would be to move the accounts that need the older version to a machine running the CloudLinux operating system. That will allow them to use the older versions in a more secure fashion with CageFS.
 

Kadence

Active Member
Nov 25, 2006
32
1
158
Hey there! Unfortunately, no, there's not going to be a way to force that to work even with a custom profile. The best option would be to move the accounts that need the older version to a machine running the CloudLinux operating system. That will allow them to use the older versions in a more secure fashion with CageFS.
Thank you. What about CentOS 7? This article says PHP 5.6 is available on CentOS 7.

https://support.cpanel.net/hc/en-us/articles/4404715760023

Would there be any issues with using CentOS 7? And/or is there any reason to prefer CloudLinux?
 

ResellerWiz

Well-Known Member
Mar 24, 2023
151
66
103
USA
cPanel Access Level
Root Administrator
Twitter
  • Like
Reactions: Kadence

KevAtkinson

Registered
Oct 31, 2021
2
2
1
United Kingdom
cPanel Access Level
Root Administrator
I had a site running some really old PHP code and was struggling after a few years away from programming to adapt it to PHP 8.x

I started a ChatGPT session, and pasted in the old code asking AI to re-write my code for PHP 8. As if by magic it re-wrote the code and even made it more efficient. I copied and pasted that back into a dev account running PHP 8.1 and the code worked a treat. Actually blew my mind!
 
  • Like
Reactions: Kadence and cPRex

bellwood

Well-Known Member
PartnerNOC
Sep 25, 2012
120
55
153
New York
cPanel Access Level
DataCenter Provider
If this is still a concern, consider using rector:


...which can handle the migration of mysql -> mysqli pretty easily:

 
  • Like
Reactions: Kadence