0

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
ilSavo
  • 854
  • 1
  • 8
  • 28

2 Answers2

1

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):

Community
  • 1
  • 1
metalfight - user868766
  • 2,722
  • 1
  • 16
  • 20
  • Thank you very much...Thanks to your advice I foud that, among my site folders I had an .htaccess file (that I haven't seen before) with a string which displayed the errors. I hope I've found, and solved, my error... – ilSavo Nov 05 '12 at 14:43
0

It is a webserver problem, because you're trying to access data on a different vhost. You need to add the location to open_basedir. You should find a configuration file under /var/www/vhosts//config/vhosts.conf. You can either add the new location you want to access or disable the open_basedir restriction. To add a new location just edit the open_basedir part (exmample):

php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp:/new/path/comes/here"

But in productive usage you should disable printing out errors. They should go to e.g. log files.

Cravid
  • 653
  • 2
  • 7
  • 22