So here's my problem. I have a PHP script that imports big CSV Files into a Database, running as a Cronjob on Apache. It worked fine but as the files get bigger I now get FastCGI Errors and the script is not running to the end. I asked my Web-Hoster and they told me I need to use "KeepAlive" or "Apache Communication" in my script during the runtime because the Apache would close the connection thinking the PHP Script is not running anymore, as the script just reads data from files, formats the data and then writes it into the Database. During that process the Timeout must happen. I cannot use "KeepAlive" directives via .htaccess, and I tried just echo something after each processed line, but it did not help. And I don't have access to apache.conf or php.conf, I have limited permissions on the php.ini though. Any help would be great, as I am out of ideas right now. :/
Asked
Active
Viewed 226 times
1
-
Does this answer your question? [Increase PHP-FPM idle timeout setting](https://stackoverflow.com/questions/40360922/increase-php-fpm-idle-timeout-setting) – cOle2 Feb 01 '22 at 20:28
-
Thanks for the link. Unfortunately I don't have access to the Apache or PHP Configuration, so not a solution I can try. – Sunny Feb 01 '22 at 20:54
-
1`running as a Cronjob on Apache` why is this a http request instead of just calling the relevant php script? – AD7six Feb 01 '22 at 21:33
-
The provider of the server only offers the execution of PHP scripts in Cronjobs via WGET and an URL. – Sunny Feb 01 '22 at 22:40
1 Answers
0
you say that you can not modify the PHP ini file to increase the connection timeout duration, so if that is not an option you should split the CSV files into smaller files and modify your php script accordingly to process the CSV files individually

mister_cool_beans
- 1,441
- 1
- 8
- 19