Turn off safe_mode and open_basedir

21.Dec.2010

If you are having problems including files outside of your home directory, there is a big chance you are having problems with safe_mode and open_basedir. There is a way of solving this problem by editing php.ini, or changing vhost.conf file, but recently I have found out you can just add settings to your vhost.conf by doing following:

Create a “vhost.conf” file in “/var/www/vhosts/DOMAIN-NAME/conf/”

<Directory /var/www/vhosts/DOMAIN-NAME/httpdocs>
php_admin_value safe_mode off
php_admin_value open_basedir none
</Directory>

Rebuild the domain configs for the particular host via:

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=DOMAIN-NAME

Good luck with solving this nasty problem!