I am trying to upload an audio to server using php. I am getting this error. I understood the problem is due to timeout. But how to change on thew server??
set_time_limit(0)
This will set the time limit to nothing (aka no time limit)
Related
I connect to SQL Server in laravel using PDO (in Wamp Server).
Normally I have no problem, but when the number of rows of results increases (more than 50,000 rows) and I also use Left Join, I get 500 error or a blank white page.
Is there a way to solve this problem?
It could be a timeout issue on processing the request (check the PHP error log to confirm this hypothesis).
By default there is this setting in php.ini:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
If processing takes more than max_execution_time value (in seconds), the script ends with fatal error.
If you are not in safe mode, you can change this value on runtime, only for single script, by:
set_time_limit ( int $seconds )
See PHP manual for details
I was getting the same issue. Not able to check laravel error page.
then I got solution.
Check .env file
APP_DEBUG=false
I have changed it to true.
I am new to AngularJs. I have payment section in my PHP project where payment response from the API is displayed in the frond-end using AngularJs.
The issue is, when the API response exceeds more that 30 seconds suddenly the default error message triggers. But in backed, the payments are doing fine and database is updating perfectly with a success message.
Can anyone help me on this ?
Thanks in advance
It might be because of the maximum execution time limit is set to 30 seconds. Increase the maximum execution time by using the below steps
Open the path/to/php/php.ini file in editor, if you are using xampp then the path will be xampp/php/php.ini
Find this in the php.ini file max_execution_time=30
Replace it with max_execution_time=180 or any time limit you want
/*Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 503 Service Unavailable error was encountered while trying to use an Error Document to handle the request.
*/
I tried set_time_limit(0);
But still doesn't work.
Quite possible your running out of memory, causing php/apache to crash.
Check what its currently set to, then if you have enough resources update it in php.ini
Turn on error_reporting and i think it is the Memory_limit
i seem to have figured out the problem the System was on a shared host Server causing the memory limit to fail
I have one website in Yii framework.
It was working fine till few days but since few days sometimes I am getting
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
This error occurs when there is more data load in page.
If I am on simple page where there is no need to get more data in page then it is working fine but when I am uploading or downloading or need more time to get data then mostly I am getting this error.
I have Windows server.
Can anybody guide me how can i solve this error?
You should check the webserver and php error logs, most probably is configuration problem
memory_limit
max_execution_time
upload_max_filesize
check http://php.net/manual/en/ini.core.php
I am working on php script which downloads and reads csv file and imports things to database. But I have a problem: when this script is working for a long time, I will get Error 500 - Internal Server Error. I don't know why, but server have set execution time on 90 sec, but my script is working longer time (about 6 minutes) and then I get this error.
When I got execution time error it's ok, because I can catch it with register_shutdown_function() and make another instance with cUrl, but this error is uncatchable for me.
Have anyone any clue how to catch it or make execution time error working ?
I tried set_time_limit(), but it's not working too, because server is in safe mode. And it's web hosting, so I can't change php.ini or something like this.
Thanks for any answer