【问题标题】:Artisan::call outputs php-fpm help textArtisan::call 输出 php-fpm 帮助文本
【发布时间】:2019-02-26 12:01:36
【问题描述】:

我正在运行一个基于 richarvey/nginx-php-fpm:latest 的 docker 容器

我有 laravel 5.5 完美运行,里面有 Dusk。

want to do dusk test with docker alpine

现在,在路线中,我有一个 Artisan::call('dusk')。这在进行工匠服务时运行良好,但在 docker 上的 nginx 中却没有。 出现“用法:php-fpm”消息。

这是我的位置块:

location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/var/run/php-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param SCRIPT_NAME $fastcgi_script_name;
         fastcgi_index index.php;
         include fastcgi_params;
     }

这一定很简单,但我想不通,如何通过使用 api 调用来调用黄昏?

PS:此设置​​允许我们进行压力测试,而不仅仅是使用 Apache Benchmark 工具加载页面。

【问题讨论】:

    标签: php laravel docker laravel-artisan alpine


    【解决方案1】:

    事实证明:php-fpm 将 PHP_BINARY 设置为 '/usr/local/sbin/php-fpm' 而不是 '/usr/local/bin/php'。

    由于我已经在扩展黄昏命令类,因此修复很简单:将 PHP_BINARY 变量替换为正确的路径。在 binary() 方法中。

    【讨论】:

      猜你喜欢
      • 2011-07-06
      • 2013-10-05
      • 1970-01-01
      • 2014-11-07
      • 1970-01-01
      • 1970-01-01
      • 2015-05-16
      • 2011-03-30
      • 2011-11-24
      相关资源
      最近更新 更多