Page 1 of 1

How do you configure VestaCP to recognize pear and not return an open_basedir error?

Posted: Sat Mar 27, 2021 3:27 pm
by bobmeetin
I have a CentOS VestaCP installation and have been trying to get SMTP mail to work so that it can be used with various forms. I checked and pear is installed under /usr/share/pear. I found a guide to check if pear is installed correctly, https://pear.php.net/manual/en/installa ... ecking.php, which is helpful. I followed all the checks and up to including System.php it looked perfect. I enabled error logging. This fails:

Code: Select all

    require_once ("System.php"); // for pear
The errors:

Code: Select all

 Warning: require_once(): open_basedir restriction in effect. File(/usr/share/pear/System.php) is not within the allowed path(s): (/home/$my_account/web/$my_domain/public_html:/home/$my_account/tmp) in /home/$my_account/web/$my_domain/public_html/smtp/test-pear.php on line 34

    Warning: require_once(/usr/share/pear/System.php): failed to open stream: Operation not permitted in /home/$my_account/web/$my_domain/public_html/smtp/test-pear.php on line 34

    Fatal error: require_once(): Failed opening required 'System.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/$my_account/web/$my_domain/public_html/smtp/test-pear.php on line 34
I added the following line to the file just to see and it did not help:

Code: Select all

    ini_set("include_path", '/usr/share/pear:' . ini_get("include_path") );
How would you fix this, get it to see the path? My technical skills are limited; please respond in layman terms.