Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MRP calculation error
09-25-2019, 12:56 AM, (This post was last modified: 09-25-2019, 12:57 AM by alanmi3833.)
#1
MRP calculation error
I suddenly have the following error when running MRP calculation, used to work fine. Did no update recently.

Any ideas

Quote:Start time: 04:42:50

Initialising tables .....

Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\webERP\includes\ConnectDB_mysqli.inc on line 57

Regards
Alan
Reply
09-25-2019, 01:12 AM,
#2
RE: MRP calculation error
Hi Alan, this should be relatively easy to fix. All that has happened is that as your number of transactions and stock items has increased the script takes longer to run, and you have come up against the PHP maximum execution time. This is done to stop scripts running on for ever and crashing the system.

You need to locate the php.ini file, the whereabouts of which depends on the operating system. Search in this file for the line:

max_execution_time=120

and change the 120 to a higher number. This should then work.

Thanks
Tim
Reply
09-25-2019, 01:23 AM,
#3
RE: MRP calculation error
Hi Tim
That was what I thought too.
Running Windows 8 with XAMPP 3.2.3.

Already changed php.ini to the following:
Quote:; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time=160

Still giving 120 as the timeout, system rebooted to make sure the change are seen by Apache, hence the question.

Regards
Alan
Reply
09-25-2019, 01:59 AM,
#4
RE: MRP calculation error
I seem to recall that XAMPP installed more than one php.ini but it's a long time ago.

You should be able to set the execution time in the script itself as per (https://www.codewall.co.uk/increase-php-...-function/), so if you put in:

ini_set('max_execution_time', 240);

at the top of MRP.php straight after the <?php line it should just set it for that script. However I have had mixed results with this, and haven't had time to find out why.

Tim

Tim
Reply
09-25-2019, 02:56 AM,
#5
RE: MRP calculation error
Nope that didn't work.

Changed the following line in ..../weberp/config.ini

Code:
$MaximumExecutionTime = 120;

to
Code:
$MaximumExecutionTime = 200;

Have to change in both php.ini and config.ini.

Working fine now again.

Thanks Tim
Reply
09-25-2019, 04:46 AM,
#6
RE: MRP calculation error
Thanks Alan I forgot about the entry in the config file. Thanks for reminding me. Glad it is sorted for you.

Tim
Reply
09-25-2019, 04:05 PM,
#7
RE: MRP calculation error
Does this entry override the php.ini file if it is less?
Do we need that entry, seems to be duplicating the entry in the php.ini file.

Regards
Alan
Reply
09-25-2019, 06:19 PM,
#8
RE: MRP calculation error
Hi Alan,

Yes this entry in the config file will always override the php.ini setting, but only for the time it takes to run that script. Obviously as every webERP script processes that file, it would stand for all webERP scripts. However by including it in there it does enable a different setting for each application running on that server, and I do see some advantages in that. So yes, my personal opinion is that we do need it, though others may have different views.

Thanks
Tim
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)