Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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_flag 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?

share|improve this question

1 Answer 1

Found the mistake. It is a stupid one.

In site 2 I am using "php_admin_flag" directive instead of "php_admin_value". Problem solved

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.