Comments (22)
If it doesn't solve it, I'll remove /dev/shm as a default.
from cachetool.
@jamieburchell It works !!! I deleted open_basedir
Thanks a lot
from cachetool.
Yes I fixed it
from cachetool.
How was cachetool installed? I guess to access /dev/shm
this requires some authorization in SELinux (https://serverfault.com/questions/81787/mysql-tmpdir-on-dev-shm-with-selinux for reference), if installed via a package I guess the correct way would be to configure the access for SELinux in it.
In general so I am not sure if /dev/shm
is a good default here to use the shared memory FS for this, as it could really just life on any drive no need for it to be in memory I would say personally.
For the In FastCGI.php line 114: Error: File not found.
are you able to turn on info
log level? I would be interested if the file is writen successfully and where as of https://github.com/gordalina/cachetool/blob/main/src/Adapte/FastCGI.php#L123
from cachetool.
How was cachetool installed?
I use the cachetool part of PHP Deployer and this downloads the phar directly for use.
I guess to access
/dev/shm
this requires some authorization in SELinux (https://serverfault.com/questions/81787/mysql-tmpdir-on-dev-shm-with-selinux for reference)
Up until Rocky Linux 9.2, this did work, but no longer unless the SELinux boolean httpd_read_user_content
is set to true
I can get around the issue by setting a specific directory using --temp-dir
but it's just annoying because I didn't need to go to the trouble of setting up a directory specifically for this purpose before.
For the
In FastCGI.php line 114: Error: File not found.
are you able to turn oninfo
log level? I would be interested if the file is writen successfully and where as of https://github.com/gordalina/cachetool/blob/main/src/Adapte/FastCGI.php#L123
Here's what I get with -vvvv
(not sure if this is the level you need, but)
[2023-05-22T14:00:09.877740+01:00] cachetool.DEBUG: Config: {"adapter":"fastcgi","extensions":["apcu","opcache"],"fastcgi":"\/run\/php-fpm\/www.sock","temp_dir":"\/tmp","fastcgiChroot":false} [] []
[2023-05-22T14:00:09.879743+01:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-05-22T14:00:09.880124+01:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-05-22T14:00:09.880420+01:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-05-22T14:00:09.880530+01:00] cachetool.INFO: Setting adapter: CacheTool\Adapter\FastCGI [] []
[2023-05-22T14:00:09.882360+01:00] cachetool.NOTICE: Executing: extension_loaded("Zend OPcache") [] []
[2023-05-22T14:00:09.882506+01:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-05-22T14:00:09.882605+01:00] cachetool.DEBUG: Loading Function: apcu_add [] []
[2023-05-22T14:00:09.882685+01:00] cachetool.DEBUG: Loading Function: apcu_cache_info [] []
[2023-05-22T14:00:09.882739+01:00] cachetool.DEBUG: Loading Function: apcu_regexp_get_keys [] []
[2023-05-22T14:00:09.882791+01:00] cachetool.DEBUG: Loading Function: apcu_cas [] []
[2023-05-22T14:00:09.882864+01:00] cachetool.DEBUG: Loading Function: apcu_clear_cache [] []
[2023-05-22T14:00:09.882917+01:00] cachetool.DEBUG: Loading Function: apcu_dec [] []
[2023-05-22T14:00:09.882966+01:00] cachetool.DEBUG: Loading Function: apcu_delete [] []
[2023-05-22T14:00:09.883015+01:00] cachetool.DEBUG: Loading Function: apcu_regexp_delete [] []
[2023-05-22T14:00:09.883063+01:00] cachetool.DEBUG: Loading Function: apcu_exists [] []
[2023-05-22T14:00:09.883110+01:00] cachetool.DEBUG: Loading Function: apcu_fetch [] []
[2023-05-22T14:00:09.883158+01:00] cachetool.DEBUG: Loading Function: apcu_inc [] []
[2023-05-22T14:00:09.883205+01:00] cachetool.DEBUG: Loading Function: apcu_sma_info [] []
[2023-05-22T14:00:09.883282+01:00] cachetool.DEBUG: Loading Function: apcu_store [] []
[2023-05-22T14:00:09.883330+01:00] cachetool.DEBUG: Loading Function: apcu_version [] []
[2023-05-22T14:00:09.883379+01:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-05-22T14:00:09.883442+01:00] cachetool.DEBUG: Loading Function: extension_loaded [] []
[2023-05-22T14:00:09.883495+01:00] cachetool.DEBUG: Loading Function: ini_get [] []
[2023-05-22T14:00:09.883544+01:00] cachetool.DEBUG: Loading Function: ini_set [] []
[2023-05-22T14:00:09.883593+01:00] cachetool.DEBUG: Loading Function: phpversion [] []
[2023-05-22T14:00:09.883640+01:00] cachetool.DEBUG: Loading Function: stat_realpath_get [] []
[2023-05-22T14:00:09.883689+01:00] cachetool.DEBUG: Loading Function: stat_realpath_size [] []
[2023-05-22T14:00:09.883737+01:00] cachetool.DEBUG: Loading Function: stat_cache_clear [] []
[2023-05-22T14:00:09.883784+01:00] cachetool.DEBUG: Loading Function: _eval [] []
[2023-05-22T14:00:09.883831+01:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-05-22T14:00:09.883891+01:00] cachetool.DEBUG: Loading Function: opcache_compile_file [] []
[2023-05-22T14:00:09.883958+01:00] cachetool.DEBUG: Loading Function: opcache_compile_files [] []
[2023-05-22T14:00:09.884014+01:00] cachetool.DEBUG: Loading Function: opcache_get_configuration [] []
[2023-05-22T14:00:09.884067+01:00] cachetool.DEBUG: Loading Function: opcache_get_status [] []
[2023-05-22T14:00:09.884115+01:00] cachetool.DEBUG: Loading Function: opcache_invalidate [] []
[2023-05-22T14:00:09.884162+01:00] cachetool.DEBUG: Loading Function: opcache_invalidate_many [] []
[2023-05-22T14:00:09.884406+01:00] cachetool.DEBUG: Loading Function: opcache_reset [] []
[2023-05-22T14:00:09.884482+01:00] cachetool.DEBUG: Loading Function: opcache_version [] []
[2023-05-22T14:00:09.884749+01:00] cachetool.DEBUG: Executing code: return extension_loaded('Zend OPcache'); [] []
[2023-05-22T14:00:09.885189+01:00] cachetool.INFO: FastCGI: Dumped code to file: /tmp/cachetool-646b6759d80774.55557353.php [] []
[2023-05-22T14:00:09.885408+01:00] cachetool.INFO: FastCGI: Requesting FPM using socket: /run/php-fpm/www.sock [] []
[2023-05-22T14:00:09.894414+01:00] cachetool.DEBUG: FastCGI: Response: {} [] []
In FastCGI.php line 114:
[RuntimeException]
Error: File not found.
Exception trace:
at phar:///var/www/releases/18/cachetool.phar/src/Adapter/FastCGI.php:114
CacheTool\Adapter\FastCGI->doRun() at phar:///var/www/releases/18/cachetool.phar/src/Adapter/AbstractAdapter.php:43
CacheTool\Adapter\AbstractAdapter->run() at phar:///var/www/releases/18/cachetool.phar/src/Proxy/PhpProxy.php:64
CacheTool\Proxy\PhpProxy->extension_loaded() at phar:///var/www/releases/18/cachetool.phar/src/CacheTool.php:197
CacheTool\CacheTool->__call() at phar:///var/www/releases/18/cachetool.phar/src/Command/AbstractCommand.php:38
CacheTool\Command\AbstractCommand->ensureExtensionLoaded() at phar:///var/www/releases/18/cachetool.phar/src/Command/OpcacheStatusCommand.php:38
CacheTool\Command\OpcacheStatusCommand->execute() at phar:///var/www/releases/18/cachetool.phar/vendor/symfony/console/Command/Command.php:299
Symfony\Component\Console\Command\Command->run() at phar:///var/www/releases/18/cachetool.phar/vendor/symfony/console/Application.php:978
Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/releases/18/cachetool.phar/src/Console/Application.php:148
CacheTool\Console\Application->doRunCommand() at phar:///var/www/releases/18/cachetool.phar/vendor/symfony/console/Application.php:295
Symfony\Component\Console\Application->doRun() at phar:///var/www/releases/18/cachetool.phar/src/Console/Application.php:131
CacheTool\Console\Application->doRun() at phar:///var/www/releases/18/cachetool.phar/vendor/symfony/console/Application.php:167
Symfony\Component\Console\Application->run() at phar:///var/www/releases/18/cachetool.phar/bin/cachetool:29
require() at /var/www/releases/18/cachetool.phar:14
opcache:status
from cachetool.
Fixed in 9.1.0
, can you test it?
from cachetool.
I can take a look next week @gordalina but I don't think that commit solves the issue of SELinux denying a script from running from /dev/shm
?
from cachetool.
Hi @gordalina unfortunately I can't test it in 9.1.0 as the affected installations need to be PHP 8.0 for now.
from cachetool.
Hi,
I have the same problem.
I tried php 8.1 and php 8.2.
I tried root user and limited user.
I used Rocky Linux 8.9.
php81 cachetool.phar opcache:reset -vvvv --fcgi=/run/php-fpm/test-93babf.socket
[2023-11-27T15:26:22.750045+00:00] cachetool.INFO: CacheTool 9.1.0 [] []
[2023-11-27T15:26:22.750866+00:00] cachetool.DEBUG: Config: {"adapter":"fastcgi","extensions":["apcu","opcache"],"temp_dir":null,"fastcgi":"\/run\/php-fpm\/test-93babf.socket","fastcgiChroot":null,"webClient":null,"webPath":null,"webUrl":null,"webAllowInsecure":null,"webBasicAuth":null,"webHost":null,"http":null} [] []
[2023-11-27T15:26:22.752049+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-27T15:26:22.752178+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-27T15:26:22.752311+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-27T15:26:22.752348+00:00] cachetool.INFO: Setting adapter: CacheTool\Adapter\FastCGI [] []
[2023-11-27T15:26:22.753563+00:00] cachetool.NOTICE: Executing: extension_loaded("Zend OPcache") [] []
[2023-11-27T15:26:22.753613+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-27T15:26:22.753645+00:00] cachetool.DEBUG: Loading Function: apcu_add [] []
[2023-11-27T15:26:22.753667+00:00] cachetool.DEBUG: Loading Function: apcu_cache_info [] []
[2023-11-27T15:26:22.753686+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_get_keys [] []
[2023-11-27T15:26:22.753704+00:00] cachetool.DEBUG: Loading Function: apcu_cas [] []
[2023-11-27T15:26:22.753721+00:00] cachetool.DEBUG: Loading Function: apcu_clear_cache [] []
[2023-11-27T15:26:22.753738+00:00] cachetool.DEBUG: Loading Function: apcu_dec [] []
[2023-11-27T15:26:22.753755+00:00] cachetool.DEBUG: Loading Function: apcu_delete [] []
[2023-11-27T15:26:22.753772+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_delete [] []
[2023-11-27T15:26:22.753789+00:00] cachetool.DEBUG: Loading Function: apcu_exists [] []
[2023-11-27T15:26:22.753805+00:00] cachetool.DEBUG: Loading Function: apcu_fetch [] []
[2023-11-27T15:26:22.753822+00:00] cachetool.DEBUG: Loading Function: apcu_inc [] []
[2023-11-27T15:26:22.753839+00:00] cachetool.DEBUG: Loading Function: apcu_sma_info [] []
[2023-11-27T15:26:22.753856+00:00] cachetool.DEBUG: Loading Function: apcu_store [] []
[2023-11-27T15:26:22.753873+00:00] cachetool.DEBUG: Loading Function: apcu_version [] []
[2023-11-27T15:26:22.753890+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-27T15:26:22.753917+00:00] cachetool.DEBUG: Loading Function: extension_loaded [] []
[2023-11-27T15:26:22.753936+00:00] cachetool.DEBUG: Loading Function: ini_get [] []
[2023-11-27T15:26:22.753954+00:00] cachetool.DEBUG: Loading Function: ini_set [] []
[2023-11-27T15:26:22.753971+00:00] cachetool.DEBUG: Loading Function: phpversion [] []
[2023-11-27T15:26:22.753988+00:00] cachetool.DEBUG: Loading Function: stat_realpath_get [] []
[2023-11-27T15:26:22.754005+00:00] cachetool.DEBUG: Loading Function: stat_realpath_size [] []
[2023-11-27T15:26:22.754022+00:00] cachetool.DEBUG: Loading Function: stat_cache_clear [] []
[2023-11-27T15:26:22.754039+00:00] cachetool.DEBUG: Loading Function: _eval [] []
[2023-11-27T15:26:22.754056+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-27T15:26:22.754083+00:00] cachetool.DEBUG: Loading Function: opcache_compile_file [] []
[2023-11-27T15:26:22.754101+00:00] cachetool.DEBUG: Loading Function: opcache_compile_files [] []
[2023-11-27T15:26:22.754120+00:00] cachetool.DEBUG: Loading Function: opcache_get_configuration [] []
[2023-11-27T15:26:22.754137+00:00] cachetool.DEBUG: Loading Function: opcache_get_status [] []
[2023-11-27T15:26:22.754155+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate [] []
[2023-11-27T15:26:22.754172+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate_many [] []
[2023-11-27T15:26:22.754188+00:00] cachetool.DEBUG: Loading Function: opcache_reset [] []
[2023-11-27T15:26:22.754205+00:00] cachetool.DEBUG: Loading Function: opcache_version [] []
[2023-11-27T15:26:22.754303+00:00] cachetool.DEBUG: Executing code: return extension_loaded('Zend OPcache'); [] []
[2023-11-27T15:26:22.754357+00:00] cachetool.INFO: FastCGI: Dumped code to file: /dev/shm/cachetool-6564b51eb82998.26705763.php [] []
[2023-11-27T15:26:22.754419+00:00] cachetool.INFO: FastCGI: Requesting FPM using socket: /run/php-fpm/test-93babf.socket [] []
[2023-11-27T15:26:22.758098+00:00] cachetool.DEBUG: FastCGI: Response: {} [] []
In FastCGI.php line 114:
[RuntimeException]
Error: No input file specified.
Exception trace:
at phar:///root/cachetool.phar/src/Adapter/FastCGI.php:114
CacheTool\Adapter\FastCGI->doRun() at phar:///root/cachetool.phar/src/Adapter/AbstractAdapter.php:43
CacheTool\Adapter\AbstractAdapter->run() at phar:///root/cachetool.phar/src/Proxy/PhpProxy.php:64
CacheTool\Proxy\PhpProxy->extension_loaded() at phar:///root/cachetool.phar/src/CacheTool.php:197
CacheTool\CacheTool->__call() at phar:///root/cachetool.phar/src/Command/AbstractCommand.php:38
CacheTool\Command\AbstractCommand->ensureExtensionLoaded() at phar:///root/cachetool.phar/src/Command/OpcacheResetCommand.php:35
CacheTool\Command\OpcacheResetCommand->execute() at phar:///root/cachetool.phar/vendor/symfony/console/Command/Command.php:308
Symfony\Component\Console\Command\Command->run() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:1002
Symfony\Component\Console\Application->doRunCommand() at phar:///root/cachetool.phar/src/Console/Application.php:148
CacheTool\Console\Application->doRunCommand() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:299
Symfony\Component\Console\Application->doRun() at phar:///root/cachetool.phar/src/Console/Application.php:131
CacheTool\Console\Application->doRun() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at phar:///root/cachetool.phar/bin/cachetool:29
require() at /root/cachetool.phar:14
opcache:reset
Can you help me ?
Thanks
from cachetool.
@rbocquet @gordalina I just tested this with cachetool 9.1.0 on PHP 8.1 and get:
[production] error in cachetool.php on line 89:
[production] run cd /var/www && /usr/bin/php /var/www/cachetool.phar opcache:reset --fcgi=/run/php-fpm/www.sock
[production] err In FastCGI.php line 114:
[production] err Error: Access denied.
[production] err opcache:reset
[production] exit code 1 (General error)
ERROR: Task cachetool:clear:opcache failed!
The only way I can "fix" it is by enabling httpd_read_user_content
:
sudo setsebool -P httpd_read_user_content 1
from cachetool.
I tried you're fixed but same problem
setsebool -P httpd_read_user_content 1
php81 cachetool.phar opcache:reset -vvvv --fcgi=/run/php-fpm/test-93babf.socket
[2023-11-27T15:46:39.745514+00:00] cachetool.INFO: CacheTool 9.1.0 [] []
[2023-11-27T15:46:39.746425+00:00] cachetool.DEBUG: Config: {"adapter":"fastcgi","extensions":["apcu","opcache"],"temp_dir":null,"fastcgi":"\/run\/php-fpm\/test-93babf.socket","fastcgiChroot":null,"webClient":null,"webPath":null,"webUrl":null,"webAllowInsecure":null,"webBasicAuth":null,"webHost":null,"http":null} [] []
[2023-11-27T15:46:39.747829+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-27T15:46:39.747970+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-27T15:46:39.748111+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-27T15:46:39.748155+00:00] cachetool.INFO: Setting adapter: CacheTool\Adapter\FastCGI [] []
[2023-11-27T15:46:39.749671+00:00] cachetool.NOTICE: Executing: extension_loaded("Zend OPcache") [] []
[2023-11-27T15:46:39.749733+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-27T15:46:39.749768+00:00] cachetool.DEBUG: Loading Function: apcu_add [] []
[2023-11-27T15:46:39.749793+00:00] cachetool.DEBUG: Loading Function: apcu_cache_info [] []
[2023-11-27T15:46:39.749816+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_get_keys [] []
[2023-11-27T15:46:39.749837+00:00] cachetool.DEBUG: Loading Function: apcu_cas [] []
[2023-11-27T15:46:39.749856+00:00] cachetool.DEBUG: Loading Function: apcu_clear_cache [] []
[2023-11-27T15:46:39.749874+00:00] cachetool.DEBUG: Loading Function: apcu_dec [] []
[2023-11-27T15:46:39.749892+00:00] cachetool.DEBUG: Loading Function: apcu_delete [] []
[2023-11-27T15:46:39.749910+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_delete [] []
[2023-11-27T15:46:39.749927+00:00] cachetool.DEBUG: Loading Function: apcu_exists [] []
[2023-11-27T15:46:39.749950+00:00] cachetool.DEBUG: Loading Function: apcu_fetch [] []
[2023-11-27T15:46:39.749969+00:00] cachetool.DEBUG: Loading Function: apcu_inc [] []
[2023-11-27T15:46:39.749987+00:00] cachetool.DEBUG: Loading Function: apcu_sma_info [] []
[2023-11-27T15:46:39.750004+00:00] cachetool.DEBUG: Loading Function: apcu_store [] []
[2023-11-27T15:46:39.750022+00:00] cachetool.DEBUG: Loading Function: apcu_version [] []
[2023-11-27T15:46:39.750040+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-27T15:46:39.750069+00:00] cachetool.DEBUG: Loading Function: extension_loaded [] []
[2023-11-27T15:46:39.750091+00:00] cachetool.DEBUG: Loading Function: ini_get [] []
[2023-11-27T15:46:39.750116+00:00] cachetool.DEBUG: Loading Function: ini_set [] []
[2023-11-27T15:46:39.750135+00:00] cachetool.DEBUG: Loading Function: phpversion [] []
[2023-11-27T15:46:39.750153+00:00] cachetool.DEBUG: Loading Function: stat_realpath_get [] []
[2023-11-27T15:46:39.750172+00:00] cachetool.DEBUG: Loading Function: stat_realpath_size [] []
[2023-11-27T15:46:39.750190+00:00] cachetool.DEBUG: Loading Function: stat_cache_clear [] []
[2023-11-27T15:46:39.750208+00:00] cachetool.DEBUG: Loading Function: _eval [] []
[2023-11-27T15:46:39.750226+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-27T15:46:39.750254+00:00] cachetool.DEBUG: Loading Function: opcache_compile_file [] []
[2023-11-27T15:46:39.750274+00:00] cachetool.DEBUG: Loading Function: opcache_compile_files [] []
[2023-11-27T15:46:39.750293+00:00] cachetool.DEBUG: Loading Function: opcache_get_configuration [] []
[2023-11-27T15:46:39.750311+00:00] cachetool.DEBUG: Loading Function: opcache_get_status [] []
[2023-11-27T15:46:39.750329+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate [] []
[2023-11-27T15:46:39.750347+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate_many [] []
[2023-11-27T15:46:39.750364+00:00] cachetool.DEBUG: Loading Function: opcache_reset [] []
[2023-11-27T15:46:39.750381+00:00] cachetool.DEBUG: Loading Function: opcache_version [] []
[2023-11-27T15:46:39.750488+00:00] cachetool.DEBUG: Executing code: return extension_loaded('Zend OPcache'); [] []
[2023-11-27T15:46:39.750600+00:00] cachetool.INFO: FastCGI: Dumped code to file: /dev/shm/cachetool-6564b9dfb73d76.32795503.php [] []
[2023-11-27T15:46:39.750709+00:00] cachetool.INFO: FastCGI: Requesting FPM using socket: /run/php-fpm/test-93babf.socket [] []
[2023-11-27T15:46:39.753883+00:00] cachetool.DEBUG: FastCGI: Response: {} [] []
In FastCGI.php line 114:
[RuntimeException]
Error: No input file specified.
Exception trace:
at phar:///root/cachetool.phar/src/Adapter/FastCGI.php:114
CacheTool\Adapter\FastCGI->doRun() at phar:///root/cachetool.phar/src/Adapter/AbstractAdapter.php:43
CacheTool\Adapter\AbstractAdapter->run() at phar:///root/cachetool.phar/src/Proxy/PhpProxy.php:64
CacheTool\Proxy\PhpProxy->extension_loaded() at phar:///root/cachetool.phar/src/CacheTool.php:197
CacheTool\CacheTool->__call() at phar:///root/cachetool.phar/src/Command/AbstractCommand.php:38
CacheTool\Command\AbstractCommand->ensureExtensionLoaded() at phar:///root/cachetool.phar/src/Command/OpcacheResetCommand.php:35
CacheTool\Command\OpcacheResetCommand->execute() at phar:///root/cachetool.phar/vendor/symfony/console/Command/Command.php:308
Symfony\Component\Console\Command\Command->run() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:1002
Symfony\Component\Console\Application->doRunCommand() at phar:///root/cachetool.phar/src/Console/Application.php:148
CacheTool\Console\Application->doRunCommand() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:299
Symfony\Component\Console\Application->doRun() at phar:///root/cachetool.phar/src/Console/Application.php:131
CacheTool\Console\Application->doRun() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at phar:///root/cachetool.phar/bin/cachetool:29
require() at /root/cachetool.phar:14
opcache:reset
from cachetool.
@rbocquet Not sure. Try making sure that the user running the command has permission on the socket file. In my case the apache
user has rw
access on the socket file, so I would run the command as the apache
user as well as making sure the SELinux bool is true:
sudo -uapache php ./cachetool.phar opcache:reset -vvvv --fcgi=/run/php-fpm/www.sock
from cachetool.
As pointed out by @jamieburchell the user running the php-fpm process needs to be able to read the file created by cachetool, if you use the same user when calling cachetool that shouldn't be an issue.
Try also using a different path with --tmp-dir=/var/run/cachetool
from cachetool.
For test, I tried chmod 777 /run/php-fpm/test-93babf.socket
to have no limits
Same problem
ls -la /run/php-fpm/test-93babf.socket
srwxrwxrwx. 1 root root 0 Nov 27 16:26 /run/php-fpm/test-93babf.socket
php81 cachetool.phar opcache:reset -vvvv --fcgi=/run/php-fpm/test-93babf.socket --tmp-dir=/var/run/cachetool
[2023-11-28T08:55:31.941831+00:00] cachetool.INFO: CacheTool 9.1.0 [] []
[2023-11-28T08:55:31.942633+00:00] cachetool.DEBUG: Config: {"adapter":"fastcgi","extensions":["apcu","opcache"],"temp_dir":"\/var\/run\/cachetool","fastcgi":"\/run\/php-fpm\/test-93babf.socket","fastcgiChroot":null,"webClient":null,"webPath":null,"webUrl":null,"webAllowInsecure":null,"webBasicAuth":null,"webHost":null,"http":null} [] []
[2023-11-28T08:55:31.943724+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-28T08:55:31.943849+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-28T08:55:31.943977+00:00] cachetool.INFO: Adding Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-28T08:55:31.944012+00:00] cachetool.INFO: Setting adapter: CacheTool\Adapter\FastCGI [] []
[2023-11-28T08:55:31.945198+00:00] cachetool.NOTICE: Executing: extension_loaded("Zend OPcache") [] []
[2023-11-28T08:55:31.945247+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\ApcuProxy [] []
[2023-11-28T08:55:31.945278+00:00] cachetool.DEBUG: Loading Function: apcu_add [] []
[2023-11-28T08:55:31.945300+00:00] cachetool.DEBUG: Loading Function: apcu_cache_info [] []
[2023-11-28T08:55:31.945318+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_get_keys [] []
[2023-11-28T08:55:31.945335+00:00] cachetool.DEBUG: Loading Function: apcu_cas [] []
[2023-11-28T08:55:31.945351+00:00] cachetool.DEBUG: Loading Function: apcu_clear_cache [] []
[2023-11-28T08:55:31.945368+00:00] cachetool.DEBUG: Loading Function: apcu_dec [] []
[2023-11-28T08:55:31.945383+00:00] cachetool.DEBUG: Loading Function: apcu_delete [] []
[2023-11-28T08:55:31.945400+00:00] cachetool.DEBUG: Loading Function: apcu_regexp_delete [] []
[2023-11-28T08:55:31.945416+00:00] cachetool.DEBUG: Loading Function: apcu_exists [] []
[2023-11-28T08:55:31.945432+00:00] cachetool.DEBUG: Loading Function: apcu_fetch [] []
[2023-11-28T08:55:31.945448+00:00] cachetool.DEBUG: Loading Function: apcu_inc [] []
[2023-11-28T08:55:31.945465+00:00] cachetool.DEBUG: Loading Function: apcu_sma_info [] []
[2023-11-28T08:55:31.945481+00:00] cachetool.DEBUG: Loading Function: apcu_store [] []
[2023-11-28T08:55:31.945850+00:00] cachetool.DEBUG: Loading Function: apcu_version [] []
[2023-11-28T08:55:31.945876+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\PhpProxy [] []
[2023-11-28T08:55:31.945906+00:00] cachetool.DEBUG: Loading Function: extension_loaded [] []
[2023-11-28T08:55:31.945926+00:00] cachetool.DEBUG: Loading Function: ini_get [] []
[2023-11-28T08:55:31.945944+00:00] cachetool.DEBUG: Loading Function: ini_set [] []
[2023-11-28T08:55:31.945961+00:00] cachetool.DEBUG: Loading Function: phpversion [] []
[2023-11-28T08:55:31.945977+00:00] cachetool.DEBUG: Loading Function: stat_realpath_get [] []
[2023-11-28T08:55:31.945994+00:00] cachetool.DEBUG: Loading Function: stat_realpath_size [] []
[2023-11-28T08:55:31.946010+00:00] cachetool.DEBUG: Loading Function: stat_cache_clear [] []
[2023-11-28T08:55:31.946026+00:00] cachetool.DEBUG: Loading Function: _eval [] []
[2023-11-28T08:55:31.946042+00:00] cachetool.INFO: Loading Proxy: CacheTool\Proxy\OpcacheProxy [] []
[2023-11-28T08:55:31.946068+00:00] cachetool.DEBUG: Loading Function: opcache_compile_file [] []
[2023-11-28T08:55:31.946086+00:00] cachetool.DEBUG: Loading Function: opcache_compile_files [] []
[2023-11-28T08:55:31.946103+00:00] cachetool.DEBUG: Loading Function: opcache_get_configuration [] []
[2023-11-28T08:55:31.946120+00:00] cachetool.DEBUG: Loading Function: opcache_get_status [] []
[2023-11-28T08:55:31.946136+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate [] []
[2023-11-28T08:55:31.946153+00:00] cachetool.DEBUG: Loading Function: opcache_invalidate_many [] []
[2023-11-28T08:55:31.946169+00:00] cachetool.DEBUG: Loading Function: opcache_reset [] []
[2023-11-28T08:55:31.946185+00:00] cachetool.DEBUG: Loading Function: opcache_version [] []
[2023-11-28T08:55:31.946290+00:00] cachetool.DEBUG: Executing code: return extension_loaded('Zend OPcache'); [] []
[2023-11-28T08:55:31.946457+00:00] cachetool.INFO: FastCGI: Dumped code to file: /var/run/cachetool/cachetool-6565ab03e708b5.50931369.php [] []
[2023-11-28T08:55:31.946554+00:00] cachetool.INFO: FastCGI: Requesting FPM using socket: /run/php-fpm/test-93babf.socket [] []
[2023-11-28T08:55:31.948064+00:00] cachetool.DEBUG: FastCGI: Response: {} [] []
In FastCGI.php line 114:
[RuntimeException]
Error: File not found.
Exception trace:
at phar:///root/cachetool.phar/src/Adapter/FastCGI.php:114
CacheTool\Adapter\FastCGI->doRun() at phar:///root/cachetool.phar/src/Adapter/AbstractAdapter.php:43
CacheTool\Adapter\AbstractAdapter->run() at phar:///root/cachetool.phar/src/Proxy/PhpProxy.php:64
CacheTool\Proxy\PhpProxy->extension_loaded() at phar:///root/cachetool.phar/src/CacheTool.php:197
CacheTool\CacheTool->__call() at phar:///root/cachetool.phar/src/Command/AbstractCommand.php:38
CacheTool\Command\AbstractCommand->ensureExtensionLoaded() at phar:///root/cachetool.phar/src/Command/OpcacheResetCommand.php:35
CacheTool\Command\OpcacheResetCommand->execute() at phar:///root/cachetool.phar/vendor/symfony/console/Command/Command.php:308
Symfony\Component\Console\Command\Command->run() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:1002
Symfony\Component\Console\Application->doRunCommand() at phar:///root/cachetool.phar/src/Console/Application.php:148
CacheTool\Console\Application->doRunCommand() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:299
Symfony\Component\Console\Application->doRun() at phar:///root/cachetool.phar/src/Console/Application.php:131
CacheTool\Console\Application->doRun() at phar:///root/cachetool.phar/vendor/symfony/console/Application.php:171
Symfony\Component\Console\Application->run() at phar:///root/cachetool.phar/bin/cachetool:29
require() at /root/cachetool.phar:14
opcache:reset
from cachetool.
Do you have SELinux enabled?
$ sestatus
from cachetool.
Yes
sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33
from cachetool.
It's in permissive mode, so that won't be the cause of the issue.
from cachetool.
Do you have any idea to solve this problem ?
Thanks
from cachetool.
Do you have any idea to solve this problem ?
Thanks
It seems like some sort of permission issue. Does the command work with sudo
?
from cachetool.
No, I use this command as root 😞
from cachetool.
Anything in PHP error logs? open_basedir
restrictions in effect?
from cachetool.
@jamieburchell It works !!! I deleted open_basedir
Thanks a lot
Instead of deleting it, you can add the path to the temp cachetool directory.
from cachetool.
Related Issues (20)
- Support for monolog/monolog ^3.0 HOT 1
- Exclude path not working with absolute path HOT 1
- PHP 8.2: ${var} string interpolation deprecated HOT 1
- apcu regex format validation HOT 1
- continuous updating message HOT 3
- Question: Can you install cachetool on 1 specific domain/subdomain instead of entire server HOT 2
- Question: About invalidation of specific scripts HOT 3
- Question: Getting weird errors HOT 2
- Invalid version string "@package_version@" with consolidation/self-update 2.2.0 HOT 5
- Tag 8.6.0 was removed, but still referenced in Packagist HOT 4
- opcache:reset FastCGI error: Unable to connect to FastCGI application: Permission denied (/run/php/php8.2-fpm.sock) HOT 1
- Question: Version compatibility HOT 1
- Not clearing cache after upgrading to php 8.1.13 + cachetool 9.1 HOT 7
- Apcu key fetch problem
- Add support for Symfony 7 HOT 6
- Question/request: Split cache library from CLI tool?
- It would be useful if output from opcache:status:scripts could be sorted by hits or memory HOT 1
- apcu get keys by regex HOT 1
- DX: success response HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachetool.