Find script causing Maximum execution time exceeded

Hi,
I have been maintaining a Yii 1.1 site for around 4 years now so its quite mature. I am consistently getting the following errors in error_log files:

Maximum execution time of 30 seconds exceeded in /home/poolstat/public_html/yii-framework-1.1.19/framework/yiilite.php on line 9567
Allowed memory size of X bytes exhausted (tried to allocate 117440544 bytes) in /home/poolstat/public_html/yii-framework-1.1.19/framework/yiilite.php on line 4837

These are examples, they are not always the same line number in the yiilite.php file.

I understand what the errors mean but I need to know which url is actually causing the error. Does anyone know how to extend the logging to include the stack trace so I can track down the culprit? The site serves around 10,000 pages a day and I only get about 6 instances of these messages daily so its not causing alot of problems, I would just like to know where they are coming from.

Regards

Greg J

It’s a while since I used v1 but I think it has an error handler that can give you a backtrace and request context for this kind of error. Check if it is configured.

But you can perhaps answer the question (which URLs are responsible?) by cross-checking the PHP error log with web server logs according to timestamp.

Sometimes you don’t want to change old code that mostly works well. So maybe you can make the problem go away by increasing memory_limit in php.ini.

Yiilite was an interesting idea but not a big success and it was abandoned in Yii 2. If you have to rework this code, it might make your life easier if you do not use it. With opcache you may have better performance without Yiilite.

1 Like

as @thefsb mentioned start by looking at the log files, another suggestion i can give try running your app with standard yii 1 package instead of yiilite.php.

1 Like

thanks for the info, I will give those things a try and see how it goes

Cheers