PHP Resource Limits problem !!!

I have a problem with my entire web sites (around 20) hosted with Virtualmin GPL. Everything was working fine for more than a year, until I needed to increase resources limit in PHP, for particular web site with Joomla. When uploading some pictures in Joomla, with Joomgallery component, I got an error uploading some slightly bigger file. I increased some of the PHP Limits (max_execution_time = 30, max_input_time = 180, upload_max_filesize = 8M and memory_limit = 64M) and the files were uploaded successfully.

But after few days I wanted to upload some file when Joomgallery wanted to increase to 65M. I increased the memory_limit to 128, and then my problem begins. Every web site that is hosted on server get an error similar to this “Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 19456 bytes) in /home …”. Some of the sites don’t show anything, just a blank white page. Most of the sites that don’t work are Joomla and one is with phpBB. The other sites that are html based work fine. Basically something is wrong with php.

All other thing on server works fine (mail, ftp, dns, mysql …). I checked all of the logs and I didn’t find any error. I tried to restore previous values, increasing and decreasing values, restarting the services, restarting the computer etc but nothing work. I don’t know what the problem is, why everything is not restored when I changed the values. Server is not using more that 40-50% of ram and more that 10% of CPU. BTW server is virtual VMware server under Ubuntu 8.04 LTS host.

It sounds like you’re tweaking the correct parameters… the PHP memory_limit is definitely the correct parameter to change for the error you listed above. Perhaps it’s being set somewhere other than the file that you’re editing.

It’s possible to setup Virtualmin GPL so that each Virtual Server uses it’s own unique php.ini file, located in $HOME/etc/php.ini. Is it possible you set that up in the past? If so, that’s where you’d need to change those variables.

Also, it’s possible to set the memory_limit in a .htaccess file, you may want to make sure there’s no such file in your DocumentRoot.

This post here on the Joomla site talks about talks a bit about the problem you’re having, and offers some potential solutions: