Symptoms
When trying to change the System's default PHP version from the "WHM / Software / MultiPHP Manager" interface, you are presented with this error:
Error: API failure: Can't call method "get_default_string" on an undefined value at /usr/local/cpanel/Cpanel/WebServer/Supported/apache.pm line 367
Alternatively, you might be presented with this error when trying to check the current EasyApache's PHP configuration:
/usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php73
ea-php73 SAPI: cgi
Cpanel::Exception::MissingParameter/(XID sv7d8q) Provide the “type” parameter for the “Cpanel::WebServer::Supported::apache::make_handler” function.
at /usr/local/cpanel/Cpanel/WebServer/Supported/apache.pm line 223.
Cpanel::WebServer::Supported::apache::make_handler(Cpanel::WebServer::Supported::apache=HASH(0x22ceae8), "lang", Cpanel::ProgLang::Supported::php=HASH(0x200b250), "package", "ea-php74", "type", undef) called at /usr/local/cpanel/bin/rebuild_phpconf line 194
bin::rebuild_phpconf::ea4::do_current(HASH(0x1f77338), Cpanel::ProgLang::Supported::php=HASH(0x200b250), Cpanel::WebServer::Supported::apache=HASH(0x22ceae8)) called at /usr/local/cpanel/bin/rebuild_phpconf line 226
bin::rebuild_phpconf::ea4::run(ARRAY(0x1a33f20)) called at /usr/local/cpanel/bin/rebuild_phpconf line 246
Description
One cause is that the "plugins" value is missing or disabled in the yum.conf file, which is known to cause EA4 rpm failures and can result in missing required packages. This may also occur if the packages for the PHP version you wish to use are not properly installed. The following instructions will help to ensure all required packages are installed.
Workaround
- We should ensure that yum is configured properly with the "plugins" option enabled. Use this to search for the option in your yum configuration:
grep "plugins" /etc/yum.conf
- If no output is returned, the "plugins" option is considered disabled. We can append the option to your configuration to enable it:
echo "plugins=1" >> /etc/yum.conf
If the "plugins" option is disabled with a "0," We can enable the option by setting it to "1":sed -i'.backup' '/^plugins=/ s/0/1/g' /etc/yum.conf
- Verify that the base package for your version of PHP is installed properly. The following command searches your installed packages when you replace ## with the version number of PHP you wish to search for, such as 74, 80, etc. If no output is returned, then the base package is missing:
rpm -qa | grep ea-php##-[1-9]
- If the base package is missing, we can install it using yum:
yum install ea-php##
- We can use a similar command to reinstall all related packages once the base package is installed:
yum reinstall ea-php##*
-
Reinstalling the packages should trigger a rebuild of the PHP configuration. Verify that EasyApache's PHP configuration has been successfully rebuilt by running this command:
/usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php73
ea-php73 SAPI: cgi
ea-php74 SAPI: cgi
Comments
0 comments
Article is closed for comments.