【问题标题】:Issues configuring CacheTool & PHP-FPM配置 CacheTool 和 PHP-FPM 的问题
【发布时间】:2020-07-21 15:34:08
【问题描述】:

我正在尝试使用来自 Deployer 的 CacheTool recipe

我在配置 cachetool 时遇到问题。

使用 WHM / cPanel 和 PHP 版本是 PHP 7.4 (ea-php74)。

set('cachetool', '/var/cpanel/php-fpm/<username>/sock'); 导致以下错误:

In AbstractCommand.php line 39:                                                                                                                                                                                                                                                               
Extension `Zend OPcache` is not loaded
                                                                                                                                                                                   
opcache:reset

为域使用特定的套接字文件: set('cachetool', '/opt/cpanel/ea-php74/root/usr/var/run/php-fpm/<hashed-domain>.sock');

结果

In FastCGI.php line 114:
Error: File not found.
opcache:reset

尝试使用 IP: set('cachetool', '127.0.0.1:9000'); 返回

================                                                                                               
In FastCGI.php line 143:                       
FastCGI error: Unable to connect to FastCGI application: Connection refused (127.0.0.1:9000)                                                                                                             
In Socket.php line 320:
Unable to connect to FastCGI application: Connection refused

In Socket.php line 270:                                  
stream_socket_client(): unable to connect to tcp://127.0.0.1:9000 (Connection refused)

opcache:reset

我对所有配置文件/可能性有点迷茫,谁能帮忙?谢谢!

【问题讨论】:

    标签: php fpm opcache php-deployer


    【解决方案1】:

    定义 --fcgi-chroot 和/或 --tmp-dir 选项以使其工作。

    来自[自述文件][1]:

    疑难解答


    [运行时异常] 错误:无法打开主脚本:/dev/shm/cachetool-584743c678dbb.php(没有这样的文件或目录) 状态:404 未找到 内容类型:text/html;字符集=UTF-8 没有指定输入文件。

    这意味着 cachetool 无法写入 /dev/shm 提供 cachetool可以通过php cachetool.phar --tmp-dir=/writable/dir或者配置写入的目录。

    ...

    • 要连接到 chrooted fastcgi 服务器,您需要设置 --fcgi-chroot--tmp-dir 参数
     php cachetool.phar opcache:status --fcgi=/var/run/php5-fpm.sock --fcgi-chroot=/path/to/chroot --tmp-dir=/path/to/chroot/tmp
    

    【讨论】:

      猜你喜欢
      • 2011-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-02
      • 1970-01-01
      相关资源
      最近更新 更多