Operating environment is Ubuntu14.04
PHP script
Either Apache or Nginx terminates when the R language is half running (the step stops when you need to wait 3-5 seconds to run)
But with PHP in command-line mode
Php-f result.php
It can be run completely.
Can you solve this problem by modifying the PHP configuration?
Reply content:
Operating environment is Ubuntu14.04
PHP script
Either Apache or Nginx terminates when the R language is half running (the step stops when you need to wait 3-5 seconds to run)
But with PHP in command-line mode
Php-f result.php
It can be run completely.
Can you solve this problem by modifying the PHP configuration?
This article is written in very detailed (English): https://rtcamp.com/tutorials/php/increase-script-execution-time/
To summarize:
- PHP.ini:
max_execution_time
should be long enough
- Php-fpm.ini:
request_terminate_timeout
should be long enough
- Nginx:
fastcgi_read_timeout
should be long enough
First of all, there is no limit to the php-cli of the script run time. You can refer to http://www.php100.com/manual/php/features.commandline.html. A regular web request is expected to respond in a short time, so the normal php-cgi script execution is limited by the maximum execution time of the configuration file, Apache fortunately some, nginx through proxy to forward the request, it will also set a maximum waiting time here, A similar error was returned 5** the time-out. If your task takes a long time to execute, it is recommended that you do not use HTTP to access PHP, you can switch to background execution