Getting "open_basedir restriction in effect" in spite of adding the correct entry.

Posted by akshatc on Server Fault See other posts from Server Fault or by akshatc
Published on 2010-05-04T20:46:01Z Indexed on 2010/05/04 20:49 UTC
Read the original article Hit count: 338

Filed under:
|

I am trying to create a shared hosting scenario, using open_basedir option of php. I am doing this by adding the following to apache2.conf

<VirtualHost *:80>
    ServerName lt1.example.net
    DocumentRoot /home/akshat/example/tmpblogs/tb1/
    php_admin_value open_basedir /home/akshat/example/tmpblogs/tb1/
</VirtualHost>

<VirtualHost *:80>
    ServerName lt2.example.net
    DocumentRoot /home/akshat/example/tmpblogs/tb2/
    php_admin_value open_basedir /home/akshat/example/tmpblogs/tb2/
</VirtualHost>

Now when I access lt2.example.net, I get the error:

Warning: Unknown: open_basedir restriction in effect. File(/home/akshat/example/tmpblogs/tb2/index.php) is not within the allowed path(s): (0) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/home/akshat/example/tmpblogs/tb2/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

I was getting the same error while accessing "lt1.example.net" too, but then it suddenly became alright.

What am I doing wrong here?

© Server Fault or respective owner

Related posts about shared-hosting

Related posts about php