Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>
    DocumentRoot /home/akshat/example/tmpblogs/tb1/
    php_admin_value open_basedir /home/akshat/example/tmpblogs/tb1/

<VirtualHost *:80>
    DocumentRoot /home/akshat/example/tmpblogs/tb2/
    php_admin_flag open_basedir /home/akshat/example/tmpblogs/tb2/

Now when I access, 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 "" too, but then it suddenly became alright.

What am I doing wrong here?

share|improve this question

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


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.