Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6819495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:18:47+00:00 2026-05-26T21:18:47+00:00

I am migrating websites to a new server and one site that is using

  • 0

I am migrating websites to a new server and one site that is using open_basedir in its sites-available file is giving me problems and just showing a blank page when I try to load it.

I have fixed it by moving the open_basedir config from the Apache VirtualHost to the front index.php page within an ini_set(). This fix bothers me though and I feel that I’m missing something. Is there a particular Apache setting that I need to change or something to get this to work in a VirtualHost config?

Note that I did restart apache after changing the sites-available file.

Here is the sites-available file:

<VirtualHost *:443>
  ServerName www.mysite.com
  ServerAdmin webmaster@mysite.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>

Here is 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 tried to just set the base directory to root (php_flag open_basedir /) and it still gave me an error.

Existing server: Debian GNU/Linux 4.0, PHP Version 5.2.0-2, Apache 2.2.3

New server: Debian GNU/Linux 6.0, PHP Version 5.3.3-7+squeeze3, Apache 2.2.16

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:18:48+00:00Added an answer on May 26, 2026 at 9:18 pm

    Try the following instead:

    <VirtualHost *:443>
        ...
        php_admin_value open_basedir "/var/www/www.mysite.com/"
        ...
    </VirtualHost>
    

    You are using *_flag where you should be using *_value.

    *_flag is for boolean values whereas *_value is for strings. See How to change configuration settings for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm migrating some websites over to another server. One of the websites is built
I am actually migrating websites to ASP.NET 4.0, having problems with the new rendering
I am migrating a mysql database from one site to another. Its encodign: utf8
I am migrating my Facebook canvas application to using the new PHP SDK. However,
I'm migrating a complex old website to a new one coded with codeigniter and
I am migrating web apps to new hosting servers, but when I try to
We are migrating our web sites from Win2003/IIS6 to Win2008/IIS7. Our .NET code is
We have migrated one of our websites from a windows 2003 machine with IIS5
our website resides on iis-server and is completely written with Expression Web using templates
i am migrating a website from asp.net to asp.net mvc in the asp.net site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.