Symptoms
When trying to install a PHP extension using PECL, the following error appears:
Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 525
ERROR: failed to run `phpize'
Description
This error indicates that the popen() function is disabled in the global php.ini
file for the affected PHP version.
[ root@server ~]# grep disable_functions /opt/cpanel/ea-php*/root/etc/php.ini
/opt/cpanel/ea-php56/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
/opt/cpanel/ea-php70/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
/opt/cpanel/ea-php71/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
/opt/cpanel/ea-php72/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
/opt/cpanel/ea-php73/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
/opt/cpanel/ea-php74/root/etc/php.ini:disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_ope
The error can also indicate that popen() is disabled in either the domain's individual PHP-FPM configuration or in the global PHP-FPM configuration.
Workaround
If the domain uses ea-php, you'll need to remove popen() from the disable_functions
variable within the global php.ini
file.
There are several ways to accomplish this.
- Manually editing the global
php.ini
file of the affected version and removing popen() from the disable functions.
This global php.ini
configuration is located in the following paths:
/opt/cpanel/ea-php56/root/etc/php.ini
/opt/cpanel/ea-php70/root/etc/php.ini
/opt/cpanel/ea-php71/root/etc/php.ini
/opt/cpanel/ea-php72/root/etc/php.ini
/opt/cpanel/ea-php73/root/etc/php.ini
/opt/cpanel/ea-php74/root/etc/php.ini
- "WHM / Software / MultiPHP INI Editor."
To do so, access "WHM /Software / MultiPHP INI Editor." Once there select click on Editor Mode, select the version of PHP you'd like to edit. Search for disable_functions and then remove popen().
If the affected domain uses PHP-FPM, please refer to the following article, which explains how to disable the function: How to modify disable_functions in WHM when using PHP-FPM.
Comments
0 comments
Article is closed for comments.