Changing the System's Default PHP Fails With "Error: API failure: Can't call method "get_default_string" on an undefined value at

rch7

Member
Sep 25, 2017
9
0
1
North America
cPanel Access Level
Root Administrator
Changing system php version from 7.3 to 7.4:
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.
I have done the steps as in:
But it doesn't change anything.
/usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php73
ea-php56 SAPI: cgi
ea-php73 SAPI: cgi
Cpanel::Exception::MissingParameter/(XID xn9ceh) 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(0x1a7bae0), "lang", Cpanel::ProgLang::Supported::php=HASH(0x17171d0), "package", "ea-php74", "type", undef) called at /usr/local/cpanel/bin/rebuild_phpconf line 194
bin::rebuild_phpconf::ea4::do_current(HASH(0x1685050), Cpanel::ProgLang::Supported::php=HASH(0x17171d0), Cpanel::WebServer::Supported::apache=HASH(0x1a7bae0)) called at /usr/local/cpanel/bin/rebuild_phpconf line 226
bin::rebuild_phpconf::ea4::run(ARRAY(0x113fe78)) called at /usr/local/cpanel/bin/rebuild_phpconf line 246
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,134
394
243
cPanel Access Level
Root Administrator
Hey there! If you're still seeing issues after making sure the plugins line is present in /etc/yum.conf and you have reinstalled that version of PHP, can you open a ticket with our team so we can check this directly? Please post the ticket number here so I can keep the community updated with our findings.
 

rch7

Member
Sep 25, 2017
9
0
1
North America
cPanel Access Level
Root Administrator
TY for the answer. Sorry there was typo in yum.conf. It seems to work now but reinstalling php gives bunch of perl errors, even when trying it again:
# yum reinstall ea-php74*

Running transaction
Installing : ea-php74-runtime-7.4.13-1.1.1.cpanel.x86_64 1/23
Installing : ea-php74-php-common-7.4.13-2.2.3.cpanel.x86_64 2/23
Installing : ea-php74-php-litespeed-7.4.13-2.2.3.cpanel.x86_64 3/23
Installing : ea-php74-php-cli-7.4.13-2.2.3.cpanel.x86_64 4/23
Installing : ea-php74-php-xml-7.4.13-2.2.3.cpanel.x86_64 5/23
Installing : ea-php74-php-devel-7.4.13-2.2.3.cpanel.x86_64 6/23
Installing : ea-php74-php-posix-7.4.13-2.2.3.cpanel.x86_64 7/23
Installing : ea-php74-php-pdo-7.4.13-2.2.3.cpanel.x86_64 8/23
Installing : ea-php74-php-ftp-7.4.13-2.2.3.cpanel.x86_64 9/23
Installing : ea-php74-pear-1.10.12-1.1.5.cpanel.noarch 10/23
Installing : ea-php74-libc-client-2007f-20.21.1.cpanel.x86_64 11/23
Installing : ea-php74-php-imap-7.4.13-2.2.3.cpanel.x86_64 12/23
Installing : ea-php74-7.4.13-1.1.1.cpanel.x86_64 13/23
Installing : ea-php74-php-mysqlnd-7.4.13-2.2.3.cpanel.x86_64 14/23
Installing : ea-php74-php-ioncube10-10.4.5-2.2.4.cpanel.x86_64 15/23
Installing : ea-php74-php-iconv-7.4.13-2.2.3.cpanel.x86_64 16/23
Installing : ea-php74-php-sockets-7.4.13-2.2.3.cpanel.x86_64 17/23
Installing : ea-php74-php-calendar-7.4.13-2.2.3.cpanel.x86_64 18/23
Installing : ea-php74-php-bcmath-7.4.13-2.2.3.cpanel.x86_64 19/23
Installing : ea-php74-php-fpm-7.4.13-2.2.3.cpanel.x86_64 20/23
Installing : ea-php74-php-gd-7.4.13-2.2.3.cpanel.x86_64 21/23
Installing : ea-php74-php-mbstring-7.4.13-2.2.3.cpanel.x86_64 22/23
Installing : ea-php74-php-curl-7.4.13-2.2.3.cpanel.x86_64 23/23
warn [009-phpconf] Error updating user package handlers for ea-php74: Cpanel::Exception::Collection/(XID zc89ph) 11 errors occurred:
Error #1: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #2: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #3: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #4: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #5: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #6: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #7: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #8: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #9: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #10: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #11: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

at /usr/local/cpanel/Cpanel/WebServer/Supported/apache.pm line 792.
Cpanel::WebServer::Supported::apache::update_user_package_handlers(Cpanel::WebServer::Supported::apache=HASH(0x12dab20), "type", "cgi", "lang", Cpanel::ProgLang::Supported::php=HASH(0x1370680), "package", "ea-php74") called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 319
ea_apache2_config::phpconf::try {...} () called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
Try::Tiny::try(CODE(0x1a77100), Try::Tiny::Catch=REF(0x1a78418)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 324
ea_apache2_config::phpconf::try {...} () called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
Try::Tiny::try(CODE(0x1a4ca28), Try::Tiny::Catch=REF(0x19b7860)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 332
ea_apache2_config::phpconf::apply_rebuild_settings(HASH(0x12b01f8), HASH(0x12b8ea0)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 349

warn [009-phpconf] Error updating user package handlers for ea-php56: Cpanel::Exception::Collection/(XID xy8guu) 8 errors occurred:
Error #1: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #2: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #3: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #4: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #5: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #6: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #7: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

Error #8: Can't locate Cpanel/FileUtils/Access.pm: /root/perl5/lib/perl5/Cpanel/FileUtils/Access.pm: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 201.
...propagated at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 290.

at /usr/local/cpanel/Cpanel/WebServer/Supported/apache.pm line 792.
Cpanel::WebServer::Supported::apache::update_user_package_handlers(Cpanel::WebServer::Supported::apache=HASH(0x12dab20), "type", "cgi", "lang", Cpanel::ProgLang::Supported::php=HASH(0x1370680), "package", "ea-php56") called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 319
ea_apache2_config::phpconf::try {...} () called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
Try::Tiny::try(CODE(0x1a77100), Try::Tiny::Catch=REF(0x1abb2b8)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 324
ea_apache2_config::phpconf::try {...} () called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 97
eval {...} called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 88
Try::Tiny::try(CODE(0x1a4ca28), Try::Tiny::Catch=REF(0x19b7860)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 332
ea_apache2_config::phpconf::apply_rebuild_settings(HASH(0x12b01f8), HASH(0x12b8ea0)) called at /etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__/009-phpconf.pl line 349

Purging all relevant cached command results

........

Setting /home permissions to 0711 …
Setting permissions for users …
site8 …
Skipping site8 because of an error: Can't locate object method "to_string" via package "Can't locate Cpanel/Exception/CORE.pm: /root/perl5/lib/perl5/Cpanel/Exception/CORE.pm: Permission denied at /usr/local/cpanel/Cpanel/Exception.pm line 64.
" (perhaps you forgot to load "Can't locate Cpanel/Exception/CORE.pm: /root/perl5/lib/perl5/Cpanel/Exception/CORE.pm: Permission denied at /usr/local/cpanel/Cpanel/Exception.pm line 64.
"?) at /usr/local/cpanel/scripts/enablefileprotect line 54.


######################################################
I believe contents of /root/.bashrc are typical for the system:
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/root/perl5";
export PERL_MB_OPT="--install_base /root/perl5";
export PERL_MM_OPT="INSTALL_BASE=/root/perl5";
export PERL5LIB="/root/perl5/lib/perl5:$PERL5LIB";
export PATH="/root/perl5/bin:$PATH";
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,134
394
243
cPanel Access Level
Root Administrator
Interesting - I'm sorry to hear you ran into additional problems.

I'd try forcing a full update with "/scripts/upcp --force" first to make sure all the cPanel files are present on the system and working well. If that doesn't get things working, please submit a ticket with our team so we can take a look directly on the system and help get that resolved.