BenM
BenM

Reputation: 53198

Max execution time

I have a site which is hosted on a dev site for demonstration to the client, and everything works without problem. However, when I download the files and database to my local EasyPHP installation, I receive the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files (x86)\EasyPHP-5.3.4.0\www\PC Estimating\classes\database.class.php on line 23

The database details for the connection are correct, as the Database object is already used on part of the template before this error is shown.

My question is, why does the system work fine on a live server, but not on EasyPHP?

Upvotes: 2

Views: 7723

Answers (3)

Gustavo Gallas
Gustavo Gallas

Reputation: 36

These issue have two possible solutions:

1) Increase the max_execution_time in your php.ini . First of all, locate this file, and then edit it. Locate this line:

max_execution_time=30

and replace by:

max_execution_time=120

And then restart your webserver.

This will increase from 30 seconds to 120 seconds. You can increase even more, according to your application needs.

2) If this setting doesn't solve the problem, you may have to look into your PHP application, because there may be an infinite loop or something similar.

More details about this problem: https://www.copahost.com/blog/increase-php-max-execution-time/

Upvotes: 0

Bastian
Bastian

Reputation: 10433

You should check the max_execution_time setting in the php.ini files on your server and on your local installation.

btw... what is done in line 23 ?

Copied from my comment to make it easier to find the solution:

some things really runs slower on windows... while on mac/unix the php connects to mysql using a file socket while it should use tcpip in windows. Try using "127.0.0.1" instead of "localhost" when connecting to the db

Upvotes: 7

SergeS
SergeS

Reputation: 11779

Because your PC is slow compared to server and/or your code is really badly optimised

Upvotes: -1

Related Questions