Search Engine: Elastic

Article ID: 129718, created on Oct 28, 2016, last review on Jun 30, 2018

  • Applies to:
  • Operations Automation


"Creating local pear installation for domain service" task fails:

Internal error: /usr/bin/pear /usr/bin/pear config-create /var/www/vhosts/9/100001 /var/www/vhosts/9/100001/.pearrc failed with code 255 saying: STDOUT: '' STDERR ''.


The value of open_basedir directive, defined in global PHP configuration file /etc/php.ini, prevents /usr/bin/pear binary from successful execution.


There are several alternatives to resolve the situation, depending on the desired outcome:

  1. [Recommended] Include all paths required by Pear into open_basedir directive at TOP > Services > Web Hosting > NG Default Configuration > PHP Configuration > Language Settings > Edit open_basedir. The values of the following directives should be present to allow Pear scripts execution:


    The values can be found inside /etc/php.ini file on any NG web server.

  2. The below solution does not imply changing global open_basedir configuration, but requires getting re-applied upon each php-pear package update, since /usr/bin/pear gets replaced with the default one.

    Correct /usr/bin/pear script and pass an empty open_basedir parameter to it:

    # cat /usr/bin/pear
    exec /usr/bin/php -C -d include_path=/usr/share/pear -d open_basedir="" \
        -d output_buffering=1 /usr/share/pear/pearcmd.php "$@"

    In case open_basedir restriction is still required for Pear (to achieve maximum security), pass the required directories together with PATH variable:

    # cat /usr/bin/pear
    PATH=/usr/bin:/usr/share:/usr/libexec/php4-cgi/bin exec /usr/bin/php -C -d include_path=/usr/share/pear \
        -d date.timezone=UTC \
        -d output_buffering=1 -d open_basedir=/usr/bin:/usr/share:/usr/libexec:/etc:/tmp:/root /usr/share/pear/pearcmd.php "$@"
  3. [Unsecure] Remove the global PHP open_basedir settings at all.

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF