Skip to main content

[CPANEL-26292] Set open_basedir and disable_functions to NULL for PECL

Comments

7 comments

  • vacancy
    0
  • lukapaunovic
    ello @vacancy, this is unrelated to this post. I'm talking here about Module Installer -> PHP Pecl installer or when you manually run pecl for specific PHP version like: /opt/cpanel/ea-phpXX/root/usr/bin/pecl install imagick
    If you have defined open_basedir to e.g.: open_basedir = "/home:/tmp:/var/cpanel/php/sessions/ea-php72"
    Like many admins do, pecl can't access /opt/cpanel/ea-php72 folder, and I doubt any of the sysadmins are aware to put /opt/cpanel/ea-php72 to allowed paths in basedir. Which will make pecl not work, also if you have defined disable functions popen/proc_open pecl won't also work. That's why setting these to NULL when running pecl is necessary. @cPanelMichael please open case for this. Thanks.
    0
  • cPanelMichael
    Hello @lukapaunovic, Can you open a
    0
  • lukapaunovic
    No, I just came here to report the issue. Here is how to reproduce: Open MultiPHP Ini editor for some PHP version in WHM, let's say 7.0 set disable_functions variable to disable_functions = "pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,show_source,system,passthru,shell_exec,proc_open,popen,phpinfo"
    Set open_basedir variable to open_basedir = "/home:/tmp:/var/cpanel/php/sessions/ea-php70"
    Now, try installing something via PECL for the version 7.0 You'll see the errors about open_basedir restriction (pecl unable to access /opt/cpanel/ea-php72), and afterward, the problems will arise because of popen disabled. That's why it's required each of the /opt/cpanel/ea-phpXX/root/usr/bin/pecl has these variables set to null so they don't interfere with PECL! I hope i explained this, I can't do it better. A regular user won't know how to troubleshoot this issue, and this will prevent many support requests being opened regarding this.
    0
  • cPanelMichael
    Hello @lukapaunovic, I've reported this as part of internal case CPANEL-26292. I'll update this thread with more information on the status of this case as it becomes available. Thank you.
    0
  • lukapaunovic
    Come one @cPanelMichael fix this already :( It's just two lines to override basdir and disable functions when pecl is running!
    0
  • cPanelMichael
    Hello @lukapaunovic, This case is an improvement request so updates to the case status may not occur as quickly as a typical defect report. I'll continue to monitor the case and update this thread with new information as it becomes available. In the meantime, the temporary workaround is to set the open_basedir and disable_functions lines to NULL in the corresponding /opt/cpanel/ea-php$$/root/usr/bin/pecl files: -d disable_functions=NULL \ -d open_basedir=NULL \
    Thank you.
    0

Please sign in to leave a comment.