How to Fix Script Timeout Error in phpMyAdmin? - php

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

Related

phpMyAdmin File Limit (already edited php.ini)

I'm trying to import a 151 MB database into phpMyAdmin and am getting the error "You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit."
I've already edited php.ini with values of upload_max_filesize, memory_limit and post_max_size that more than accommodate this file. Is there anything else I can do to troubleshoot?
Try setting max_execution_time and max_input_time with higher values.
max_execution_time = 90
max_input_time = 120
You might want to try memory_limit as well and don't forget to restart the server.

PHP file upload size limits

I know this question has been asked before, but I've gone through all previously described options and I'm wondering if I'm missing an option. I'm trying upload a file through Apache/PHP that is greater than 2.000GB in size. Files smaller than that work fine.
The following php.ini variables are set, and I have restarted Apache to make sure they are in effect:
max_input_vars = 10000
post_max_size = 5000M
upload_max_filesize = 5000M
max_file_uploads = 1000
max_execution_time = 600
max_input_time = 600
memory_limit = 10000M
I am using a javascript uploader, with no filesize limits in the script, and a PHP page to receive the uploaded files, also with no limits in the script. When it fails, it only gives this error message in the javascript console in Chrome and IE: Failed to load resource: net::ERR_CONNECTION_RESET. There are file size limit checks in the javascript and PHP pages, but those errors are never displayed... so I'm thinking it is not even getting the chance to check the file size in either place.
In case anyone hits this 2.0GB limit, the fix for me was that PHP 5.4 did not support uploads greater than 2.0GB. This limit was changed in PHP 5.6: http://php.net/ChangeLog-5.php#5.6.0
Upgrading to PHP 7.0 worked for me!

Changing post_max_size to 512M not being affected on WAMP

I have read other answers here on stackoverflow, however this is a really weird issue.
My phpinfo() shows that I have set 512M for the post_max_size (I have also increased other properties to at least 512M)
However when I am trying to send post request from Angular HTTP to Laravel 5.2 api, I get 422 Unprocessed Entitym and php_error says:
PHP Warning: Unknown: POST Content-Length of 7323588 bytes exceeds the limit of 3145728 bytes in Unknown on line 0
I have changed both php.ini files,despite only one being loaded.
Step 1: Go to the folder destination where you have installed WAMP. (Usually it is C:)
Step 2: Now locate and open php.ini files from both these locations. (C:\wamp\bin\apache\Apache2.4.4\bin and C:\wamp\bin\php\php5.4.16)
Step 3: Now in both the documents press CTRL+F and find out the following settings.
post_max_size
upload_max_filesize
memory_limit
For example you will see upload_max_filesize = 2m where m is MB. Change 2m to 500m or more as you like.
Change post_max_size = 8m to post_max_size = 700m or more. Change memory_limit = 8m to memory_limit = 1000m.
Other than that to avoid fatal errors like maximum time of something exceeded in line something, find and change the following values.
max_execution_time = 30 to to max_execution_time = 3000 and max_input_time = 60 to 3000.
This was an interesting problem.
The issue was following:
Yes, I needed to change the post_max_size, however at one point in my php.ini I had it set to 1000M.
My Apache 2.4.9 , and PHP 5.5.12 decided to ignore the suffix M and I ended up with a limit of 1000 Bytes.
My solution was to set post_max_size = 1000000 to have the limit set to 1MB

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