Search code examples
phpsymfony-1.4open-basedir

open_basedir() warning with Symfony1.4


Often browsing my site I can see this php warning:

Warning: is_readable(): open_basedir restriction in effect. File(/var/www/vhosts/<my site>/httpdocs/apps/frontend/modules/.sf/config/config_handlers.yml) is not within the allowed path(s): (/var/www/vhosts/<my site>/httpdocs/:/tmp/) in /var/www/vhosts/<my site>/httpdocs/lib/vendor/symfony/lib/config/sfConfigCache.class.php on line 305

The real problem is that Google is indexing my pages with that warning...

As specify in the title, I'm using Symfony 1.4.18. How can I solve it?

Is it a Symfony bug, or is a PHP kind of restriction that I can go around It?


Solution

  • The real problem is that Google is indexing my pages with that warning...

    On your production server you should always have display_errors = Off.

    1. Open your php.ini file.
    2. Add display_errors = Off
    3. restart Apache

    opendir: Limit the files that can be opened by PHP to the specified directory-tree, including the file itself.

    Check this answer : open_basedir restriction in effect. File(/) is not within the allowed path(s):