open_basedir causing issues with WHM php-pecl module installers

RickKukiela

Member
Jan 17, 2017
16
1
3
Chicago
cPanel Access Level
Root Administrator
WHM -> module installers -> php pecl (manage)

After a quick scan the following output is produced:
Path Warning: is_executable(): open_basedir restriction in effect. File(/usr/local/jdk/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/kerberos/sbin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/kerberos/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/local/sbin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/local/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/sbin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/sbin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/X11R6/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/local/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/X11R6/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/root/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/opt/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: is_executable(): open_basedir restriction in effect. File(/usr/local/bin/gpg) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in System.php on line 535 Warning: file_exists(): open_basedir restriction in effect. File(/root/.pearrc) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in Config.php on line 653 Warning: file_exists(): open_basedir restriction in effect. File(/opt/cpanel/ea-php74/root/etc/pear.conf) is not within the allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom) in Config.php on line 662 /opt/cpanel/ea-php74/root/usr/lib64/php/modules

Why does my open basedir configuration effect processing running from the context of the WHM, and how should I go about fixing this? Should I add all of these directories its looking to check files in to my open_basedir allowed path list or is there something else going on here?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,984
922
313
cPanel Access Level
Root Administrator
Hey there! My guess would be there is something else going on here, although I'm not entirely sure what that may be based on just that information. Do you know if there have been any customizations made to PHP 7.4 on the system?

If you aren't able to track down anything we'd be happy to check the server directly if you get a ticket submitted to our team.
 

RickKukiela

Member
Jan 17, 2017
16
1
3
Chicago
cPanel Access Level
Root Administrator
The only customizations I've done is made 7.4 the system default and *only* version of php currently available (new server). In addition to that, I have enabled open_basedir in the php.ini and set it to the path listed on every error output above: allowed path(s): (/opt/cpanel/composer:/home:/usr/bin/unzip:/usr/bin/env:/usr/local/php-include:/usr/local/share:/opt/cpanel/ea-php74/root/usr/share/pear:/tmp:/dev/urandom).

This configuration seems to work fine for the sites but I guess the script that runs when you visit the WHM php pecl modules page tries to access files outside of my open_basedir config.

I would have assumed that the WHM stuff would load a different php.ini but I guess this is not the case.

TBH, I dont even use PECL modules so it was just happenstance that I noticed this issue. Being the way I am, I like to resolve issues even if they arent directly effecting me at the time.

I guess i'm just trying to figure out ouf if this is normal based on the actions I've taken, and what I should do to resolve it, even if its adding all of these paths to the open_basedir paths...
 

RickKukiela

Member
Jan 17, 2017
16
1
3
Chicago
cPanel Access Level
Root Administrator
Honestly, it looks like its just trying to find the gpg binary in about 30 different spots. Not sure why it wouldnt just do "which" to get the actual location or better yet, just run `gpg` and let the system PATH environment sort it out but I digress. My gpg binary is installed to /usr/bin/gpg, I could certainly add /usr/bin to the the open basedir allowed paths, no problem here. Howerver its still going to check all the other locaitons and spit out these warnings. Maybe I just need to do that and also turn off `warnings` off in the default `error_reporting` setting...?