pear , pecl not working after EasyApach4

vipin

Active Member
Aug 23, 2013
28
0
1
cPanel Access Level
Root Administrator
Hi,

After using EasyApache4 , PHP extensions cannot be installed using pear / pecl. Cannot find any php-pear packages in easyapache4 repositories. What is the package name ?

System details:

Code:
[email protected] [~]# grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf ; httpd -v ; php -v ; mysql -V

/etc/redhat-release:CentOS release 6.7 (Final)

/usr/local/cpanel/version:11.52.0.20

/var/cpanel/envtype:virtuozzo

CPANEL=release

Server version: Apache/2.4.16 (cPanel)

Server built:  Oct  2 2015 14:55:33

PHP 5.5.30 (cli) (built: Oct  5 2015 18:10:12)

Copyright (c) 1997-2015 The PHP Group

Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

mysql  Ver 14.14 Distrib 5.5.46, for Linux (x86_64) using readline 5.1

Error Message when trying to install extension using PECL. It still use old PHP libraries.

Code:
[email protected] [~]# pecl install gd

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/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 /usr/local/lib/php/PEAR/Command.php on line 249
XML Extension not found
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi,

PEAR should still work fine. All the PEAR installer does is download the extensions to the '/home/$user/php' directory. I've verified this works fine on both 11.50 and 11.52. You can install PEAR extensions inside cPanel -> PHP PEAR Packages.

PECL however is absolutely broken with EasyApache 4. We need to do a bit of work on it, but we haven't had a chance to look at it yet. We hope to have this fixed up in 11.54.

Thanks for your patience, and thanks for trying out EasyApache 4!
 

Jesse Lanning

Registered
Nov 27, 2015
2
5
3
Syracuse
cPanel Access Level
Root Administrator
I got this to work by editing the pecl script. From command line as root:
Code:
pico`which pecl`
On the last line where it says:
Code:
exec $PHP -C -n -q $INCARG -d date.....
I simply removed the -n flag and the PHP Pecl Module Installer in WHM began working again.

I am not sure if this breaks anything else so do so at your own risk.
 

sadlyblue

Registered
Mar 5, 2015
3
1
78
cPanel Access Level
Root Administrator
I got this to work by editing the pecl script. From command line as root:
Code:
pico`which pecl`
On the last line where it says:
Code:
exec $PHP -C -n -q $INCARG -d date.....
I simply removed the -n flag and the PHP Pecl Module Installer in WHM began working again.

I am not sure if this breaks anything else so do so at your own risk.
Thank you. This worked for me also, after sometime searching, finally found your solution.
 
  • Like
Reactions: M4kr

stratogod

Registered
Feb 1, 2016
3
1
3
Columbia, MO, USA
cPanel Access Level
Root Administrator
I'm back to report that although this temp fix does allow you to install PHP extensions using PECL via WHM Module Installer - unfortunately, it still doesn't work. The error message goes away and it says the package is installed, however, the new extension still needs to be rebuilt into PHP somehow.

I know you guys are still working on a fix for PEAR/PECL for EA4, but in the meantime, is there a manual way to force EA4 to rebuild using new extensions that were added via PECL? I have 2 PHP extensions (memcached and redis) that I have manually installed using PECL in command line and everything appears to be fine, however, phpinfo and php -m continues to NOT show they are installed - which leads me to believe PHP/Apache need to be rebuilt... like re-configuring a provision/plan in EA4, only a manual way to do it via command line?

Hope this makes sense??? Thanks!
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
I'm back to report that although this temp fix does allow you to install PHP extensions using PECL via WHM Module Installer - unfortunately, it still doesn't work. The error message goes away and it says the package is installed, however, the new extension still needs to be rebuilt into PHP somehow.

I know you guys are still working on a fix for PEAR/PECL for EA4, but in the meantime, is there a manual way to force EA4 to rebuild using new extensions that were added via PECL? I have 2 PHP extensions (memcached and redis) that I have manually installed using PECL in command line and everything appears to be fine, however, phpinfo and php -m continues to NOT show they are installed - which leads me to believe PHP/Apache need to be rebuilt... like re-configuring a provision/plan in EA4, only a manual way to do it via command line?

Hope this makes sense??? Thanks!
Hi,

After building the PECL module, you need to add the .so to the appropriate php.d directory and then add the INI entry to the appropriate php.ini as well. After that is complete, the module should be available via PHP.

I hope this helps!
 

chrisbuk

Well-Known Member
PartnerNOC
Dec 7, 2003
395
1
168
Liverpool, United Kingdom
cPanel Access Level
DataCenter Provider
Twitter
HI Guys

in WHMCS i get an error with a custom module that requires PEAR

Code:
Fatal error: require(): Failed opening required 'PEAR.php' (include_path='/home/username/public_html/vendor/phpseclib/phpseclib/phpseclib:.;/path/to/php/pear:/home/username/public_html/modules/registrars/centralnic/php-epp') in /home/username/public_html/modules/registrars/centralnic/centralnic.php on line 14

I upgraded to EA4 and using 56 build 3.

Does anyone have a guide on how to get PEAR installed on EA4/PHP5.6
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi

Can you please put in a ticket on this? We've tested WHMCS on EA4 quite heavily, and the error you posted looks to point to a module that might need updating. However, if we can look at it we'll be able to pin it down and assist in getting it fixed.
 

chrisbuk

Well-Known Member
PartnerNOC
Dec 7, 2003
395
1
168
Liverpool, United Kingdom
cPanel Access Level
DataCenter Provider
Twitter
Hi

Can you please put in a ticket on this? We've tested WHMCS on EA4 quite heavily, and the error you posted looks to point to a module that might need updating. However, if we can look at it we'll be able to pin it down and assist in getting it fixed.
Hey Jacob,

Great seeing you the other night!
I already have a ticket open and was advised to go back to EA3 which i've not yet done, see ticket 7520075
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,225
463
I already have a ticket open and was advised to go back to EA3 which i've not yet done, see ticket 7520075
Would you mind reopening this support ticket, or opening a new ticket, and referencing this thread in the ticket so we can take a closer look again?

Thank you.
 
Last edited by a moderator:

chrisbuk

Well-Known Member
PartnerNOC
Dec 7, 2003
395
1
168
Liverpool, United Kingdom
cPanel Access Level
DataCenter Provider
Twitter
Would you mind reopening this support ticket, or opening a new ticket, and referencing this thread in the ticket so we can take a closer look again?

Thank you.
Done
 

mcgee

Registered
Jan 22, 2014
4
0
1
cPanel Access Level
Root Administrator
I got this to work by editing the pecl script. From command line as root:
Code:
pico`which pecl`
On the last line where it says:
Code:
exec $PHP -C -n -q $INCARG -d date.....
I simply removed the -n flag and the PHP Pecl Module Installer in WHM began working again.

I am not sure if this breaks anything else so do so at your own risk.
doing vi /usr/local/bin/pecl and removing the -n works fine cPanel should really fix this in the next update saves time.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,225
463

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi everyone,

I wanted to let you know that today you'll be getting updated packages that include our SCL PEAR & PECL packages for EA4. They are required for each ea-php## package, so you'll automatically get them. This will include a working PEAR & PECL binary for each supported PHP version.

Full UI support should be coming in v58 of cPanel & WHM. I hope this helps! Let us know if you come across any problems or have any suggestions.
 

butterthebiscuit

Registered
May 27, 2016
2
0
1
Roanoke, VA
cPanel Access Level
Root Administrator
Jacob P, Is there anything we need to do to with the updates to get PECL working? I'm still getting the same error. Unless I'm reading your message incorrectly, it sounds like the update was automatic and should be working now.