I have script that takes long time to execute. In a result server responds in 503 error. How can I set longer execution time?
In my PHP script I set:
set_time_limit(0);
ignore_user_abort(true);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This question is very similar to PHP Background Processes. So read that; In addition,
First you need to change the time limit in php.ini; you cannot change it in the script itself. Or in .htaccess using
php_valueSecond, you may be you want to modify how you interact with user more friendly so that the page uses an update; you can explore ajax; http-refresh; multipart pages for different approaches. If you are doing long calculations perhaps you can launch them in the background and update a database, retrieve the results later.