7

I coded a script for database import, it makes a few jobs on database. When I work this script, after a few minutes I'm getting "504 Gateway Timeout Error".

I increased all timeout values on php.ini, also I increased execution times but it is still same.

birlikbilisim
  • 163
  • 2
  • 5
  • 14

2 Answers2

7

You can increase maximum execution time in php.

ini_set('max_execution_time', 300); //300 seconds = 5 minutes
Adnan Ahmad
  • 848
  • 1
  • 13
  • 12
  • hi thanks for this. I am making a call to a stripe API and it takes more than around 5 seconds and so I am getting a "gateway timeout" error.. can you tell me where do I put this code in my script? thanks – Sarah Mar 19 '17 at 22:18
  • increased nothing happened to me. – Ravi Sharma Nov 01 '21 at 04:27
5

Write an info file on your server containing

<?php phpinfo();

View the file in your browser and check the max_execution_time

check max whats comes here

If it's 0 then there is something different to do else make sure you changed on correct ini file.

You can also check your ini file location

enter image description here

If you still can't fix it please reply :)

Tony
  • 9,672
  • 3
  • 47
  • 75
Sabbir
  • 1,374
  • 1
  • 15
  • 23