Script timeout passed error on MAMP phpmyadmin - php

I'm trying to upload this sql file that's 225MB to phpmyadmin with MAMP.
However, I keep getting this error
Script timeout passed, if you want to finish import, please resubmit the same file and import will resume.
I've changed the php.ini file in MAMP like so:
max_execution_time = 6000
max_input_time = 6000
memory_limit = 1000M
post_max_size = 750M
upload_max_filesize = 750M
I've also changed the setting in \phpmyadmin\libraries\config.default.php, like this:
$cfg['ExecTimeLimit'] = 0;
Is there any other solution that works for this issue?
Thank you.

I think You need to change the execution time limit in config.default.php as following:
$cfg['ExecTimeLimit'] = 3600; // whatever time you want to put as execution time
As the script is running out of time so you should have to increase its execution time in MAMP and restart.

I just ran into this problem myself and here is my fix.
I am using Mamp Pro, so I searched for phpmyadmin on my mac using Finder search bar.
It found a file called config.inc.php. The file was living under /Library/Application Support/appsolute/MAMP PRO/phpMyAdmin
I then found the line for $cfg['ExecTimeLimit'] and changed the value to 3600.
Save the file. Restart Mamp Pro. Database imported successfully.

Related

codeigniter -- helper and nice_date [duplicate]

I keep getting this PHP error:
Fatal error: Maximum execution time of 300 seconds exceeded
I have tried setting my max_execution_time and my max_input_time settings in php.ini (both apache and cli) to 0, -1 and 4000 seconds each.
And i still get the error saying:
Fatal error: Maximum execution time of 300 seconds exceeded
As well my script runs over 300 seconds before i get this message
I am running the script through command line.
I also checked my phpinfo() so see which php.ini I am using.
Even more interesting I have tried setting max_execution_time and max_input_time settings to 5 second and my script will run way beyond 5 seconds before I get the:
Fatal error: Maximum execution time of 300 seconds exceeded
If you are using WAMP Go to :
Increase the max_execution_time in php.ini then go to
C:\wamp\apps\phpmyadmin3.4.10.1\libraries (change path according to your installation)
open config.default.php and change value for $cfg['ExecTimeLimit'] to 0:
$cfg['ExecTimeLimit'] = 0;
This will resolve the issue for PhpMyAdmin imports.
Xampp Users
Go to xampp\phpMyAdmin\
Open config.inc.php
Search for $cfg['ExecTimeLimit'] = 300;
Set a larger value or change to 0 for unlimited
If not found add $cfg['ExecTimeLimit'] = 900; (or 0 for unlimited)
Save the file and restart the server
Important: setting the execution time limit to unlimited is not recommended.
At the beginning of your script you can add.
ini_set('MAX_EXECUTION_TIME', '-1');
I encountered a similar situation, and it turns out that Codeigniter (the PHP framework I was using) actually sets its own time limit:
In system/core/Codeigniter.php, line 106 in version 2.1.3 the following appears:
if (function_exists("set_time_limit") == TRUE AND #ini_get("safe_mode") == 0)
{
#set_time_limit(300);
}
As there was no other way to avoid changing the core file, I removed it so as to allow configuration through php.ini, as well as give the infinite maximum execution time for a CLI request.
I recommend recording this change somewhere in the case of future CI version upgrades however.
For Xampp Users
1. Go to C:\xampp\phpMyAdmin\libraries
2. Open config.default.php
3. Search for $cfg['ExecTimeLimit'] = 300;
4. Change to the Value 300 to 0 or set a larger value
5. Save the file and restart the server
6. OR Set the ini_set('MAX_EXECUTION_TIME', '-1'); at the beginning of your script you can add.
Try something like the following in your script:
set_time_limit(1200);
go to the xampp/phpmyadmin/libraries/config.default.php
and make the following changes
from $cfg['ExecTimeLimit'] = ’300′;
to $cfg['ExecTimeLimit'] = ’0′;
This is the the right answer:
go to
c:\wamp\apps\phpmyadmin3.4.10.1\libraries\config.default.php
find and set
$cfg['ExecTimeLimit'] = 0;
restart all services
and done.
For Local AppServ
Go to C:\AppServ\www\phpMyAdmin\libraries\config.default.php
Find $cfg['ExecTimeLimit'] and set value to 0.
So it'll look like
$cfg['ExecTimeLimit'] = 0;
If xampp in localserver
Goto C:\xampp\phpMyAdmin\libraries\config.default.php
//find $cfg['ExecTimeLimit']= 300;
//increase this value
$cfg['ExecTimeLimit'] = 3000;
So, after spending hours, this works for me (2023)
adding $cfg['ExecTimeLimit'] = 6000; into xampp/phpMyAdmin/config.inc.php
also I change $cfg['ExecTimeLimit'] = 6000; in xampp/phpMyAdmin/libraries/configdefault.php
PHP's CLI's default execution time is infinite.
This sets the maximum time in seconds a script is allowed to run
before it is terminated by the parser. This helps prevent poorly
written scripts from tying up the server. The default setting is 30.
When running PHP from the command line the default setting is 0.
http://gr.php.net/manual/en/info.configuration.php#ini.max-execution-time
Check if you're running PHP in safe mode, because it ignores all time exec settings when on that.
On Xampp, in php.ini you must check mysql.connect_timeout either. So, for example, change it to:
mysql.connect_timeout = 3600
That time will be always counted in seconds (so 1 hour in my example)
MAMP USERS
editing php.ini solves this - there is a line:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
setting this to a higher value worked.
the file is in php/php5.6.25/conf/php.ini (obviousl you need to wet the file for the php version you are using - you can find this out from the MAMP preferences.
If you are on xampp and using phpMyadmin to import large sql files and you have increased max_execution time, max file upload limit and everything needed And If none of the above answers work for you come here
Go to your xampp folder, in my case here is the relative path to the file that I need to modify: C:\xampp\phpMyAdmin\libraries\config.default.php
/**
* maximum execution time in seconds (0 for no limit)
*
* #global integer $cfg['ExecTimeLimit']
* by defautlt 300 is the value
* change it to 0 for unlimited
* time is seconds
* Line 709 for me
*/
$cfg['ExecTimeLimit'] = 0;
WAMP USERS:
1) Go to C:\wamp\apps\phpmyadmin
2) Open config.inc
3) Add $cfg['ExecTimeLimit'] = ’3600′; to the file.
4) Save the file and restart the server.
This file overwrites the php.ini and will work for you!
In my case, when I faced that error in Phpmyadmin, I tried MySQL-Front and import my DB successfully.
Note: You can still use the provided solutions under this question to solve your problem in Phpmyadmin.
If above answers will not work, try to check your code,,In my experience,having an infinite loop will also cause that problem.Check your else if statement.
In Codeignitor version 3.0.x the system/core/Codeigniter.php do not contain the time constraint as well as inserting
ini_set('MAX_EXECUTION_TIME', -1);
will not work since codeignitor will override that with its own function set_time_limit() .
So either you have to delete that function from codeignitor or simply you can insert
set_time_limit('1000');
in the beginning of the php file if you wanna change that to 1000 seconds.
Set the time to 0 (zero) if you want to run it as long as it want.
On wamp in my configuration where I have multiple phpmyadmins, the values in config files were overwritten in wamp/alias/phpmyadmin.conf. I set up two lines there:
1. php_admin_value max_execution_time 3600
2. php_admin_value max_input_time 3600
... it finally worked!
For OpenServer
modules\system\html\openserver\phpmyadmin\libraries\config.default.php
change
$cfg[‘ExecTimeLimit’] = 600
You can set time limit:
ini_set('max_execution_time', 1000000000000000);

Import file in MAMP(file size exceeded the maximum size permitted)

I want to import a file(85 MB) at my local server.
I changed in the php.ini the following values of the three variables (upload_max_filesize, memory_limit and post_max_size) exactly as I saw at same problems, with the right order, I restarted my MAMP server and my laptop but it didn't change anything and I can't import files more than 2 MB.
Can you give any advise to fix it ?
You need to edit the php.ini file for the php version you are using. i.e. v7.2.1.
First check which version you're using by going to
MAMP-> Preferences -> PHP -> Select/Specify PHP Version
Then go to /Applications/MAMP/bin/php/php7.2.10/conf/php.ini and input the new settings there.
Stop your server and restart MAMP. Import should now run as expected.
Cheers.
Once you find out which version of PHP your MAMP is running, find the php.ini file at C:\MAMP\conf\php7.2.10\php.ini.
You'll need to change BOTH upload_max_filesize and post_max_size. If you only update the first, it'll default to the post_max_size.
Restart the MAMP and you should be good to go.
First check your PHP version
then according to your php version you have to go this php version file (php.ini)
and the change like below... :)
post_max_size = 256M
; Maximum allowed size for uploaded files.
upload_max_filesize = 256M
; Maximum execution time of each script, in seconds
max_execution_time = 600
; Maximum amount of time each script may spend parsing request data
max_input_time = 600
; Maximum amount of memory a script may consume (8MB)
memory_limit = 512M
I did all these things but nothing happened.I have two files with the name "php.ini",the first is "php.ini-development" and the second is "php.ini-production".Because i don't know which is the correct file to change the values,i changed the values and at the two because my phpinfo have like a Loaded Configuration File this:"C:\MAMP\conf\php7.0.13\php.ini" and not one of the two.
If you are seeing timeouts, you can increase max_execution_time and max_input_time.

How to Fix Script Timeout Error in phpMyAdmin?

I am getting script timeout issue while importing a database from a zip. The error shows as-
Script timeout passed, if you want to finish import, please resubmit
same file and import will resume.
I tried setting $cfg['ExecTimeLimit'] = 0; inside phpmyadmin4.1.14/libraries/config.default.php.
Also inside my php.ini I set both max_input_time and max_execution_time to 0.
The zip size is around 33 MB and I'm using WAMP server.
What could be the other cases for which I'm getting this error?
Since you get script time out, shouldn't you increase the max_execution_time in php.ini instead of reducing it?
Try with the following values:
post_max_size = 500M
upload_max_filesize = 500M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M
EDIT: just noticed that max_execution_time is hardcoded to 0, still you can try the above settings.
Please be aware that apache also has an execution time.
Apache Wait Time for Input/Output
Edit file C:\WampDeveloper\Config\Apache\extra\httpd-default.conf
Timeout = 300
This issue commonly arise when we working on heavy load php application. This error comes when you are getting bulk of data from database. Then this type of issue come. You should check the following things in you code.
Check you database queries properly.
With Select statement you should use the Limit offset.
Check each table should have the primary key.
This issue also come when we are upload images or some thing like wise. Some time we did get solution for the heavy load image's then we try to change the logic and try to solve the issue. One more thing that you should check you php.ini configuration setting Increase these values in MB.As follows.
post_max_size = 500M
upload_max_filesize = 500M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M

phpMyAdmin trying to input database, file too big

I am trying to import a database that is 9,451 KB and 1,933 KB zipped up. When I try to import this database I get this error: You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
I have tried setting the following settings and restarted my local machine and I still get the same error:
upload_max_filesize = 100000000000000000000000000000M
memory_limit = 10000000000000000000000000000000000000M
post_max_size = 1000000000000000000000000000000000000M
max_execution_time = 5000000000000
max_input_time = 500000000000
What Am I doing wrong :(
First thing, there are lot of 0s in your settings!!
You don't require such high allocations. Keep the default settings.
Just change upload_max_filesize = 64M and post_max_size = 64M
Now, getting to the point. Why you problem still persists.
You modified the wrong php.ini file. Check if there's another php.ini file in the system.
You don't require to restart your whole machine. Simply restarting the server would be enough.
Try these and see if it works out!
The phpMyAdmin documentation also has some additional hints, solutions, and workarounds.

Fatal error : execution time of 30 seconds exceeded in phpMyAdmin

I have a MySQL table which contains 6.5 million records. When I try to access that table from phpMyAdmin I get:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp-new\phpMyAdmin\libraries\display_tbl.lib.php on line 1457.
I am just trying to view the records and I am not doing any query which might cause the error.
This problem is only in my server. And my local machine does not contain as many records as the server.
In my php.ini I have already set the maximum execution time to maximum.
How do I fix this error?
Add this line
$cfg['ExecTimeLimit'] = 6000;
to phpmyadmin/config.inc.php
And Change php.ini and my.ini
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M
max_allowed_packet = 200M (in my.ini)
if you are using xammp on the xammp control panel at the apache line click on config and then click to open PHP(php.ini) find and increase max_execution_time=30 to max_execution_time=600.
+1 for making me lookup lakhs. That looks like a PHP timeout to me as the default timeout is 30 seconds. Increase the setting in your php.ini and restart apache and see if the timeout persists.
http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time
you need to set max_execution_time in php.ini
max_execution_time=6000
HAPPY CODING
This solution has resolved the issue
Place the following lines at the top of the script page and before the query that initiates the memory:
ini_set('max_execution_time', 0);
set_time_limit(1800);
ini_set('memory_limit', '-1');
Go to:
xampp\phpMyAdmin\libraries\config.default.php
Look for : $cfg['ExecTimeLimit'] = 600;
change '600' to '6000'.
Open the xampp folder at your computer where it is installed. For example, it is at C: drive into my PC, and then open the phpMyAdmin and then libraries folder.
"C:\xampp\phpMyAdmin\libraries”
you will find a file there named, "config.default.php". Open the file into any editor or in notepad and find the line "$cfg['ExecTimeLimit'] = 300;", change the value to 0. i.e. $cfg['ExecTimeLimit'] = 0; and save the file. After saving the file restart your xampp control panel.
Hurrah! Your problem has been solved.

Categories