Forum

Cron stops
 
Notifications
Retirer tout

Cron stops

13 Posts
2 Utilisateurs
0 Reactions
12.5 K Vu
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 
[#2103]

Hello Babynus,
Cron stops with the following reason and doesn t restart anymore.

Fri Nov 21 14:26:14.222055 2014] [:error] [pid 4496:tid 1736] [client 192.168.1.58:58603] PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\projeqtor\model\Cron.php on line 302, referer: http://192.168.1.12/projeqtor/view/main.php

We cannot define if this is caused by Apache or Projeqtor.
Do you have any idea for thus issue please?
Regards, ND


 
Posté : 21/11/2014 6:03 pm
(@babynus)
Posts: 14952
Membre Admin
 

Most possible your PHP is running in safe mode.
In this mode set_time_limit(0) has no effect.


 
Posté : 21/11/2014 10:23 pm
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

PHP is not running in safe mode.
Any other idea?


 
Posté : 23/11/2014 10:49 pm
(@babynus)
Posts: 14952
Membre Admin
 

Chech log file for warning.
Do you have message such as :

WARNING : try to extend time limit to 0 seconds forbidden by safe_mode. This may lead to unsuccessfull operation.

Try and test some php code to check that

set_time_limit(0);

works fine and extends php running time to unlimited.


 
Posté : 24/11/2014 1:29 am
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

Thanks for your quick reply.
I don t find the message warning in logs.
And I m not skilled enough to run test php code.
I don t find the string "set_time_limit" in any files of wamp folder!!! Is this strange or not?


 
Posté : 24/11/2014 12:12 pm
(@babynus)
Posts: 14952
Membre Admin
 

Try the attached script (after unzipping and copying into your web directory)
Run it from a browser.

It should result in something like :

SET REPORTING LEVEL TO GET ALL ERRORS
SET TIME LIMIT TO UNLIMITED EXECUTION
OK, NEW TIME LIMIT ACCEPTED BY PHP
SCRIPT RUNNING FOR 0 S
SCRIPT RUNNING FOR 10 S
SCRIPT RUNNING FOR 20 S
SCRIPT RUNNING FOR 30 S
SCRIPT RUNNING FOR 40 S
SCRIPT RUNNING FOR 50 S
SCRIPT RUNNING FOR 60 S
SCRIPT RUNNING FOR 70 S
SCRIPT RUNNING FOR 80 S
SCRIPT RUNNING FOR 90 S
SCRIPT RUNNING FOR 100 S
...
SCRIPT RUNNING FOR 110 S

never ending

If it stops after 30 seconds, it means set_time_limit(0) failed. This is the case when PHP is in safe mode.
Try and change php.ini

max_execution_time = 300 

but this is only for testing, as it is not good practice to keep it to zero in production mode.

You may also face some time limit defined in Apache or IIS.


 
Posté : 24/11/2014 9:13 pm
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

he script works fine and over 30 secondes when max_execution_time = 30 and over 300 secondes when max_execution_time = 300.
I also tested max_execution_time = 0 and your script works fine also.

We run Apache (within WAMPServer)
below the full description of error message of Apache lof file :

[Wed Nov 26 14:26:54.749764 2014] [:error] [pid 5208:tid 1688] [client 192.168.1.58:49600] PHP Fatal error: Maximum execution time of 300 seconds exceeded in C:\wamp\www\projeqtor\model\Cron.php on line 302, referer: http://192.168.1.12/projeqtor/view/main.php
[Wed Nov 26 14:26:54.749764 2014] [:error] [pid 5208:tid 1688] [client 192.168.1.58:49600] PHP Stack trace:, referer: http://192.168.1.12/projeqtor/view/main.php
[Wed Nov 26 14:26:54.749764 2014] [:error] [pid 5208:tid 1688] [client 192.168.1.58:49600] PHP 1. {main}() C:\wamp\www\projeqtor\tool\cronRun.php:0, referer: http://192.168.1.12/projeqtor/view/main.php
[Wed Nov 26 14:26:54.749764 2014] [:error] [pid 5208:tid 1688] [client 192.168.1.58:49600] PHP 2. Cron::run() C:\wamp\www\projeqtor\tool\cronRun.php:6, referer: http://192.168.1.12/projeqtor/view/main.php


 
Posté : 26/11/2014 6:58 pm
(@babynus)
Posts: 14952
Membre Admin
 

Try and update your php.ini

safe_mode=off

 
Posté : 26/11/2014 8:28 pm
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

it was set :
safe_mode=off


 
Posté : 28/11/2014 1:30 am
(@babynus)
Posts: 14952
Membre Admin
 

Can you look for

disable_functions

in php.ini

You should not have something like

disable_functions = set_time_limit

Remove if you have it.


 
Posté : 28/11/2014 12:44 pm
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

sorry to annoy you with this topic.

There is nothing with disable function!


 
Posté : 28/11/2014 2:24 pm
(@babynus)
Posts: 14952
Membre Admin
 

Sorry, no more idea.
What is sure, is that is comes from your PHP settings.
Maybe you can try another xAMP stack, at least for testing purpose.


 
Posté : 28/11/2014 5:23 pm
(@ndusch)
Posts: 80
Estimable Member
Début du sujet
 

thanks for your help.
I tried with a new version of WAMP x64 and a version of uWamp.
The result is same.


 
Posté : 29/11/2014 9:35 pm
Share:
Retour en haut