• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Renamed domain and open_basedir did not get set correctly

jas8522

Basic Pleskian
Just a tip for anyone else who might run into this issue.

A customer renamed their domain within Plesk. Everything got set properly by Plesk *except* the custom php.ini config variable for open_basedir, which remained with the old domain name. This resulted in errors like the following in the error_log:

[Mon Sep 10 17:51:34 2012] [warn] [client {ip}] mod_fcgid: stderr: PHP Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/{OLD_DOMAIN}/httpdocs/:/tmp/) in /var/www/vhosts/{NEW_DOMAIN}/httpdocs/{DIR_TO_FILE} on line XYZ

I first tried telling Plesk to regenerate the configuration with the (outdated) command:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost={NEW_DOMAIN}

But that did not work -- it reconfigured everything, but missed the open_basedir config variable yet again.

The solution was to manually edit the custom php.ini located at /var/www/vhosts/{NEW_DOMAIN}/etc/php.ini

And change:

open_basedir = "/var/www/vhosts/{OLD_DOMAIN}/httpdocs/:/tmp/"

To:

open_basedir = "/var/www/vhosts/{NEW_DOMAIN}/httpdocs/:/tmp/"

And all is now working as expected. I'm using Plesk 10.4.4 Update #36
 
Just a quick update to note that the same occurs with all subdomains associated with the domain. I then had to edit the etc/php.ini config for each subdomain to fix them as well.
 
Back
Top