I have a script that imports data from one system to another so it is a system that requires time since it passes almost 300,000 records.
For this I have created a class with PHP using the laravel framework but I get an error 504 when executing the script
Gateway Timeout The gateway did not receive a timely response from the upstream server or application.
Apache / 2.4.29 (Ubuntu) Server at local Port 80
That's why what I do is, in the constructor class, set a series of parameters of the php, but with all that I keep getting the error.
The class code is just like this:
class CarsController extends Controller
{
function __construct() {
ini_set('max_execution_time', 999999);
ini_set('max_input_time', 999999);
ini_set('default_socket_timeout', 999999);
ini_set('memory_limit','4096M');
parent::__construct();
}
public function readMigration()
{
//Realizar las acciones SQL
}
}
The php configuration uses php7.2-fpm and I have the following
; Default timeout for socket based streams (seconds)
; http://php.net/default-socket-timeout
default_socket_timeout = 60
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 36000
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 36000
; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64
; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = -1