简体   繁体   English

配置 CacheTool 和 PHP-FPM 的问题

[英]Issues configuring CacheTool & PHP-FPM

I'm trying to use the CacheTool recipe from Deployer.我正在尝试使用 Deployer 的CacheTool 配方

I'm having issues with the configuration of cachetool.我在配置 cachetool 时遇到问题。

Using WHM / cPanel and PHP version is PHP 7.4 ( ea-php74 ).使用 WHM / cPanel 和 PHP 版本是 PHP 7.4 ( ea-php74 )。

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

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

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

results in结果是

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

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

================                                                                                               
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

I'm a bit lost in all configuration files/possibilities, anyone who can help?我对所有配置文件/可能性有点迷茫,谁能帮忙? Thanks!谢谢!

Define --fcgi-chroot and/or --tmp-dir options to make it work.定义--fcgi-chroot和/或--tmp-dir选项以使其工作。

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

Troubleshooting故障排除


[RuntimeException] Error: Unable to open primary script: /dev/shm/cachetool-584743c678dbb.php (No such file or directory) Status: 404 Not Found Content-type: text/html; [RuntimeException] 错误:无法打开主脚本:/dev/shm/cachetool-584743c678dbb.php(没有这样的文件或目录)状态:404 未找到内容类型:文本/html; charset=UTF-8 No input file specified. charset=UTF-8 未指定输入文件。

This means that cachetool could not write to /dev/shm provide a directory that cachetool can write to through php cachetool.phar --tmp-dir=/writable/dir or configuration.这意味着 cachetool 无法写入/dev/shm提供 cachetool 可以通过php cachetool.phar --tmp-dir=/writable/dir或配置写入的目录。

... ...

  • To connect to a chrooted fastcgi server you need to set --fcgi-chroot and --tmp-dir parameters要连接到 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM