Hi. Using Apache/2.2 + PHP/5.2, I'm suffering an odd issue when accessing an image generated with PHP. When I access: http://www.foo.com/script.php I get *SOMETIMES* this error message Forbidden You don't have permission to access /script.php on this server. Code (markup): This is my Apache configuration (I use Plesk) DocumentRoot "/var/www/vhosts/foo.com/httpdocs/web" <Directory "/var/www/vhosts/foo.com/httpdocs/web"> php_admin_value open_basedir "/var/www/vhosts/foo.com/httpdocs:/tmp:/usr/share/pear/plugins:/usr/share/php/plugins" Order Allow,Deny Allow from all AllowOverride all DirectoryIndex index.php </Directory> Code (markup): Most of times I access ok to the image, without any error message. Any similar experience? All my files have the same owner and the same permissions. Thank you very much.
Since it is not regular, I'd think it is a server protection issue, to block your site from loading too much at a time or something. This happens a lot on site that attract a lot visitors on shared hosting.
I have seen this error message when the server reaches its maximum number of open file handles. That would also explain the randomness of the error message. It all depends on how many other files you have open at the same time. You might be able to tell if this is the problem by running "lsof" on your server. You may also just need to tell your hosting company about the problem and get them to fix it.
You are probably right. I was suffering a lot of these error messages on my Apache 'error_log' file [Wed Mar 26 13:05:39 2008] [warn-phpd] mmap cache can't open /var/www/vhosts/foo.com/httpdocs/classes/Threads.php - Too many open files (pid 17650) [Wed Mar 26 13:05:42 2008] [warn-phpd] mmap cache can't open /var/www/vhosts/foo.com/httpdocs/classes/User.php - Too many open files (pid 17650) [Wed Mar 26 13:05:46 2008] [warn-phpd] mmap cache can't open /var/www/vhosts/foo.com/httpdocs/lib/Functions.php - Too many open files (pid 17650) Code (markup): Which I'm trying to fix by rising the file limit: []# ulimit -n 16384 Code (markup): Thank you very much for your answer.