0

i have code that need more than 20 min to execute.

I try adding ini_set('max_execution_time', 5500); or max_execution_time=0 but still getting 504 Gateway Time-out nginx/1.3.7.

note that i use shared hosting. i can't use ssh or access direct to php ini for modify.

so , any idea how to fix this problem?

sometimes it do well but 95% of times it fail.

tnx in advance

EDIT:

i cant use linux command to edit php ini file , or use VIM

Khir
  • 25
  • 3
  • 3
    Possible duplicate of [Set ini max\_execution\_time doesn't work](http://stackoverflow.com/questions/22658908/set-ini-max-execution-time-doesnt-work) – roberto06 Jan 11 '17 at 16:10
  • @roberto06 , He use `vim` that need access to server ! – Khir Jan 11 '17 at 16:13
  • Sorry, didn't see that you used shared hosting. I'm afraid there's really no way to increase the max execution time without asking your hosting company. Or you could rewrite your script so it will stop after, say, 19 minutes and call itself again, on a new thread (but that might be overkill). – roberto06 Jan 11 '17 at 16:17
  • @roberto06 , your second idea might ignore some record , true? any example? – Khir Jan 11 '17 at 16:19
  • Not necessarily, let's say your script is launched by browsing `www.example.com/myscript.php`, and after 19 minutes, you've treated the elements 1 to 2589, then you could launch it again by calling `www.example.com/myscript.php?start=2590`. – roberto06 Jan 11 '17 at 16:22
  • @roberto06 , good idea , but i can't split my data into 2 or more part – Khir Jan 11 '17 at 16:26
  • @roberto06, ;) maybe – Khir Jan 11 '17 at 16:39

0 Answers0