PHP 脚本上的 504 网关超时错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18561625/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:47:52  来源:igfitidea点击:

504 Gateway Time-out Error on PHP Script

phptimeouthttp-status-code-504

提问by birlikbilisim

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".

我编写了一个用于数据库导入的脚本,它在数据库上做了一些工作。当我使用此脚本时,几分钟后我收到“504 网关超时错误”。

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

我增加了 php.ini 上的所有超时值,也增加了执行时间,但它仍然相同。

回答by Adnan Ahmad

You can increase maximum execution time in php.

您可以在 php 中增加最大执行时间。

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

回答by Sabbir

write a info file on server

在服务器上写一个信息文件

<?php phpinfo();

check max whats comes herecheck max whats comes here if its return 0 then there is something different to do else make sure you changed on correct ini file

检查最大什么来这里检查 max whats 如果它返回 0 那么有一些不同的事情要做其他确保你在正确的 ini 文件上进行了更改

enter image description hereYou can check your ini file location also from phpinfo() function

在此处输入图片说明您也可以从 phpinfo() 函数检查您的 ini 文件位置

If you still can't fix it please response again :)

如果您仍然无法修复它,请再次回复:)