I'm moving websites to an alternative server and something site that's using open_basedir in the sites-available file is giving me problems and merely showing an empty page after i attempt to load it.
I've fixed it by moving outdoors_basedir config in the Apache VirtualHost towards the front index.php page inside an ini_set(). This fix bothers me though and that i believe I am missing something. It is possible to particular Apache setting that I have to change or something like that to get this operate in a VirtualHost config?
Observe that Used to do restart apache after altering the websites-available file.
This is actually the sites-available file:
<VirtualHost *:443> ServerName www.mysite.com ServerAdmin email@example.com DocumentRoot /var/www/www.mysite.com/content php_flag open_basedir /var/www/www.mysite.com/ SSLEngine On SSLCertificateFile /etc/ssl/certs/www_mysite_com.crt SSLCertificateKeyFile /etc/ssl/private/www_mysite_com.key SSLCACertificateFile /etc/ssl/certs/DigiCertCA.crt RewriteEngine on FileETag INode MTime Size ExpiresActive On ExpiresDefault "access plus 1 week" ExpiresByType text/html "access plus 5 seconds" CustomLog /var/log/apache2/access.log combined </VirtualHost>
This is actually the error Apache is giving me (/var/log/apache2/error.log):
... PHP Warning: Unknown: open_basedir restriction in effect. File(/var/www/www.mysite.com/content/index.php) is not within the allowed path(s): (0) in Unknown on line 0 ... PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 ... PHP Fatal error: Unknown: Failed opening required '/var/www/www.mysite.com/content/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
I even attempted to simply set the bottom directory to root (php_flag open_basedir /) also it still provided a mistake.
Existing server: Debian GNU/Linux 4., PHP Version 5.2.-2, Apache 2.2.3
New server: Debian GNU/Linux 6., PHP Version 5.3.3-7+squeeze3, Apache 2.2.16
Try the next rather:
<VirtualHost *:443> ... php_admin_value open_basedir "/var/www/www.mysite.com/" ... </VirtualHost>
*_flag best places to be utilising
*_flag is perfect for boolean values whereas
*_value is perfect for strings. See How you can change configuration configurations to learn more.