2

I have hook_cron which imports excel file and saves nodes. When I run cron with file which have only 100 items it is ok, but when I upload file with size of 13 mb with thousands of rows it gives 502 gateway. And it doesnt add even one node.

I know this can be duplicated question, but I didnt find right solution for my case. I have tried take out limitations:

ini_set('memory_limit', '-1');
ini_set('max_execution_time', 3600);
ini_set('max_input_time', 3600);

Sorry for my english and not knowing terms, but I really need help, I hope you will offer appropriate solution. If something is misunderstandable or you have any questions, please ask

Thank you in advance.

Karl Buys
  • 439
  • 5
  • 12
Аки
  • 45
  • 2
  • 10
  • [Understanding and Fixing 502 Bad Gateway Errors](https://www.lifewire.com/502-bad-gateway-error-explained-2622939) – Andy Nov 24 '16 at 01:23
  • http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size – Fky Nov 25 '16 at 14:14
  • thank you, I have fixed that, but now I have another problem :) I am using elysia cron and it is not running automatically. uploaded the last dev version – Аки Nov 25 '16 at 15:08
  • @Аки do you remember how you fixed it? I'm having the same issue. – Damodar Bashyal Oct 17 '22 at 00:57

1 Answers1

0

The answer to this could differ depending on a number of factors.

First off, you can try setting the following in your php.ini file

; Maximum allowed size for uploaded files.
upload_max_filesize = 16M

; Must be greater than or equal to upload_max_filesize
post_max_size = 16M

If that still doesn't work, try changing:

max_execution_time = 600
max_input_time = 360

It's very likely that the exact cause of the error is sitting in your server's error log file.

What would help is if you could create a PHP file that looks like so, and run it:

<?php
phpinfo();
?>

Find the error_log setting, and open that file. Look for an error message to do with the 502 error. It'll likely have an error message that explains in more detail where the problem lies.

Not knowing your system, there are further steps you can take, but I would need to know exactly what you're running.

Karl Buys
  • 439
  • 5
  • 12