1

I have one large PHP script, which is built up of separate sections:

  • RSS feed fetching (SimplePie)
  • storing items in MySQL DB
  • check item content for images (checking for img tags with DOMDocument())
  • generating crops from each image found (using PHP Image Magician)

Each section takes around 10-20 MB of server RAM. I checked this using:

echo memory_get_usage(true);

My server has a RAM of 300 MB, and just to be sure, I manually set the max_execution_time to 300 for long execution time and bumped up any memory limit just in case.

I have verified the memory limit and execution time with:

ini_set('max_execution_time', 300);
ini_set('memory_limit', '256M');
echo ini_get('max_execution_time');
echo ini_get('memory_limit');

However, still, after about 90-120 seconds, the script just stops and I get an Internal Server Error message.

Where exactly is my problem ?

4

0 回答 0