Laravel Forge计划任务上的504网关超时错误

时间:2017-08-02 07:51:25

标签: php nginx

我使用Laravel Forge部署了一个旧的自定义PHP应用程序,并且有几个计划任务无法运行。我尝试从终端运行它们并为此命令wget https://app/cronjobs/get-provider-stats我得到以下输出:

--2017-08-02 10:30:47--  https://app/cronjobs/get-provider-stats
Resolving app (app)... 46.xxx.xxx.xxx
Connecting to app (app)|46.xxx.xxx.xxx|:443... connected.
HTTP request sent, awaiting response... 504 Gateway Time-out
Retrying.

--2017-08-02 10:31:48--  (try: 2)  https://app/cronjobs/get-provider-stats
Reusing existing connection to app:443.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: ‘get-provider-stats’

get-provider-stats文件中有504个网关超时HTML页面内容。

我还检查了nginx日志,这是输出:

2017/08/02 10:32:48 [error] 4342#4342: *438 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: app, request: "GET /cronjobs/get-provider-stats HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock", host: "app"

我尝试更改下面列出的PHP CLI配置:

max_inputution_time = 300 (from 30)
max_input_time = 600 (from 60)

这并没有解决我的问题。任何想法我还能尝试什么?

1 个答案:

答案 0 :(得分:0)

这不是暂停的问题。

请重新检查你的cron命令。

由于它没有得到任何响应,它会抛出504。

尝试指定cron选项..