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

标签 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)

但这并没有解决我的问题。我还有什么想法可以尝试吗?

最佳答案

这不是超时问题。

请重新检查您的 cron 命令。

由于它没有收到任何响应,因此抛出 504。

尝试指定 cron 选项..

关于php - Laravel Forge 计划任务上的 504 网关超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45454703/

相关文章:

nginx - Nginx 中的 301 重写永久重定向

javascript - 是否可以让来自 NGINX(端口 443)的 SSL 页面也在端口 3000 上使用 socket.io(通过 Node.js)

php - Laravel 排除投票的帖子

php - 如何使用更新批量查询更改 codeigniter 中的多行

linux - 在 Nginx 上将 http 重写为 https

ssl - NGINX http ://example. com 到 https ://www. example.com 重写,如何?

php - PDO 在 Mysql 中插入多个复选框值

PHP 解析 ISO 格式的日期

PHP 日期问题,无法转换 1970-01-01 之前的日期

nginx - 通过 useragent nginx 配置重定向 IE 7 和 IE 11