Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error in PECL for PHP 7.0 under CentOS 7

Discussion in 'EasyApache' started by Kent Brockman, Jul 29, 2017.

Tags:
  1. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,160
    Likes Received:
    5
    Trophy Points:
    68
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello guys, I noticed this issue in two servers already:
    I use to enable PECL APCu on servers with PHP 7.0/7.1. This worked perfect on all my CentOS 6.9 servers.

    But when it comes to install APCu for PHP 7.0 on CentOS 7.3, I got this shown in screen:
    (notice: this does not happen on PECL for PHP 7.1, even if both have the same active modules, so it must be a bug)

    Code:
    Path Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: honorsbaseinstall in Role.php on line 173 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: installable in Role.php on line 139 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: phpfile in Role.php on line 204 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Notice: Undefined index: config_vars in Role.php on line 46 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249 Warning: Invalid argument supplied for foreach() in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Command.php on line 249 XML Extension not found

    Any ideas on why this may be happenning?
    Thanks in advance!
     

    Attached Files:

  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,484
    Likes Received:
    60
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    The error you gave has something in the last that states : XML Extension not found. Can you confirm this module is installed on the PHP 7 of your installation?

    Have you tried something like below on your server?

    # pecl install apcu-(Version)
     
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,160
    Likes Received:
    5
    Trophy Points:
    68
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yep, XML is installed already.

    I wouldn't try that, as cPanel is now able to install PECL items for specific, available PHP versions installed. I'm not sure if this is something you can install globally without doing a mess.
     

    Attached Files:

    #3 Kent Brockman, Jul 31, 2017
    Last edited by a moderator: Jul 31, 2017
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you reproduce the issue when installing that PECL module via the command line for PHP 7.0? EX:

    Code:
    /opt/cpanel/ea-php70/root/usr/bin/pecl install apcu
    Also, please post the output from the following command:

    Code:
    rpm -qa|grep php-xml
    Thank you.
     
  5. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,160
    Likes Received:
    5
    Trophy Points:
    68
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Michael, the problem is when you try to install acpu using the WHM UI. I tried from the command line for PHP 7.1 and worked like a breeze:
    Code:
    /opt/cpanel/ea-php71/root/usr/bin/pecl install apcu
    This worked ok on CentOS 6.9!


    And the one below worked ok on CentOS 7.3!
    Code:
    /opt/cpanel/ea-php70/root/usr/bin/pecl install apcu

    This is the output on CentOS 7.3:
    Code:
    rpm -qa|grep php-xml
    ea-php55-php-xmlrpc-5.5.38-22.22.5.cpanel.x86_64
    ea-php71-php-xml-7.1.7-1.1.6.cpanel.x86_64
    ea-php56-php-xml-5.6.31-1.1.6.cpanel.x86_64
    ea-php56-php-xmlrpc-5.6.31-1.1.6.cpanel.x86_64
    ea-php55-php-xml-5.5.38-22.22.5.cpanel.x86_64
    ea-php70-php-xml-7.0.21-1.1.6.cpanel.x86_64
    ea-php54-php-xml-5.4.45-38.38.5.cpanel.x86_64
    ea-php71-php-xmlrpc-7.1.7-1.1.6.cpanel.x86_64
    ea-php54-php-xmlrpc-5.4.45-38.38.5.cpanel.x86_64
    ea-php70-php-xmlrpc-7.0.21-1.1.6.cpanel.x86_64
    
    and this one is the output in my CentOS 6.9:
    Code:
    rpm -qa|grep php-xml
    ea-php70-php-xml-7.0.21-1.1.6.cpanel.x86_64
    ea-php55-php-xmlrpc-5.5.38-22.22.5.cpanel.x86_64
    ea-php71-php-xml-7.1.7-1.1.6.cpanel.x86_64
    ea-php54-php-xml-5.4.45-38.38.5.cpanel.x86_64
    ea-php55-php-xml-5.5.38-22.22.5.cpanel.x86_64
    ea-php70-php-xmlrpc-7.0.21-1.1.6.cpanel.x86_64
    ea-php56-php-xml-5.6.31-1.1.6.cpanel.x86_64
    ea-php54-php-xmlrpc-5.4.45-38.38.5.cpanel.x86_64
    ea-php71-php-xmlrpc-7.1.7-1.1.6.cpanel.x86_64
    ea-php56-php-xmlrpc-5.6.31-1.1.6.cpanel.x86_64
    
    Do you see anything odd?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The output you provided looks normal, and I'm unable to reproduce this issue on a test system. Could you open a support ticket using the link in my signature so we can take a closer look?

    Thank you.
     
  7. petersphilo

    petersphilo Member

    Joined:
    Nov 14, 2016
    Messages:
    13
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Paris
    cPanel Access Level:
    Reseller Owner
    Hello, i ran into the same issue and found a solution..
    Backround:
    i have 3 versions of php installed: 5.6, 7.0 and 7.1
    in WHM->Module Installers->PHP PECL
    the installer worked fine for 7.0 (didn't check 5.6), but not 7.1; it would display an entire page filled with error messages like this:
    and at the very end was this mention:
    so i found this solution on serverfault
    Basically, the installer is using the -n option, which disregards any custom .ini files and, as such, ignores the xml extension, which it needs in order to function properly

    except, instead of simply executing nano `which pear` to remove the -n option, you have to modify a version appropriate file.
    in the case of php 7.1, it is as follows:
    Code:
    nano /opt/cpanel/ea-php71/root/usr/bin/pecl
    Interestingly, the contents of /opt/cpanel/ea-php71/root/usr/bin/pecl and /opt/cpanel/ea-php70/root/usr/bin/pecl are quite different..

    here is /opt/cpanel/ea-php71/root/usr/bin/pecl -- note the -n option at the beginning of the last line
    Code:
    #!/bin/sh
    
    # first find which PHP binary to use
    if test "x$PHP_PEAR_PHP_BIN" != "x"; then
      PHP="$PHP_PEAR_PHP_BIN"
    else
      if test "/opt/cpanel/ea-php71/root/usr/bin/php" = '@'php_bin'@'; then
        PHP=php
      else
        PHP="/opt/cpanel/ea-php71/root/usr/bin/php"
      fi
    fi
    
    # then look for the right pear include dir
    if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
      INCDIR=$PHP_PEAR_INSTALL_DIR
      INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
    else
      if test "/opt/cpanel/ea-php71/root/usr/share/pear" = '@'php_dir'@'; then
        INCDIR=`dirname $0`
        INCARG=""
      else
        INCDIR="/opt/cpanel/ea-php71/root/usr/share/pear"
        INCARG="-d include_path=/opt/cpanel/ea-php71/root/usr/share/pear"
      fi
    fi
    
    exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"
    
    and here is /opt/cpanel/ea-php70/root/usr/bin/pecl
    Code:
    #!/bin/sh
    exec /opt/cpanel/ea-php70/root/usr/bin/php -C \
        -d include_path=/opt/cpanel/ea-php70/root/usr/share/pear \
        -d date.timezone=UTC \
        -d output_buffering=1 \
        -d variables_order=EGPCS \
        -d safe_mode=0 \
        -d register_argc_argv="On" \
        /opt/cpanel/ea-php70/root/usr/share/pear/peclcmd.php "$@"
    
    EDIT: the php56 file looks much like the php70 file, and is confirmed working on my system.
    Finally, i'll note that php71 is my default php version -- not sure whether that makes a difference here.
    Clearly, though, when i installed php71 through EasyApache 4, the default Pecl script was used, rather than the custom one used by php56 and php70....
     
    #7 petersphilo, Sep 14, 2017
    Last edited: Sep 14, 2017
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Can you verify which version of cPanel is installed on this system? Also, are you using the latest available packages offered in the EA4 yum repo (E.g. running "yum update" shows no available updates)?

    Thank you.
     
  9. petersphilo

    petersphilo Member

    Joined:
    Nov 14, 2016
    Messages:
    13
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    Paris
    cPanel Access Level:
    Reseller Owner
    @cPanelMichael: WHM is v66.0.19, and 'yum update' results in 'No packages marked for update'...
    Also, i just migrated my server from EA3 to EA4 and, once that was done, from php54 + php55 + php56 to php56 + php70 + php71 last week; i made php71 the default and enabled php-fpm

    Note: the above solution worked perfectly
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    eva2000 likes this.
Loading...

Share This Page