Supervisor 解决 can't find command *

简介

通过 supervisorctl status 查看,发现出现 can't find command 'php'

情况

  1. 查看 supervisor 的运行状态

    kqVNhmcvM0.png!large
  2. ini 配置文件

    aJ8GZ7x1aI.png!large

原因

执行 command=php artisan queue:work --queue=test_queue --tries=3 的时候找不到 php 命令

解决

  1. 查看 php 的运行目录 which php

  2. ini 配置文件的 command 的 php 加上绝对路径

    hSmmCov828.png!large
  3. 重新加载一下 Supervisor

    supervisorctl reload


按道理我 PHP 的 bin 目录已经加在了 全局变量 里面,应该是可以执行的,难道是运行用户的问题?

本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 1
tangq

可能是他在你设置的目录里边去找php命令了。猜的哈。

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!