Estou recebendo o erro abaixo em um servidor CentOS 9 Stream quando uma solicitação chega do PHP. Parece que o módulo phpFastCache não consegue gravar no diretório de cache.
2024/06/19 10:06:34 [error] 4789#4789: *285 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Phpfastcache\Exceptions\PhpfastcacheIOException: The directory /var/www/html/core/cache/127.0.0.1/Files could not be created.
Additional information provided by error_get_last():
mkdir(): Permission denied in /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php line 176 in /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php:177
Stack trace:
#0 /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php(131): Phpfastcache\Drivers\Files\Driver->mkdir()
#1 /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Drivers/Files/Driver.php(48): Phpfastcache\Drivers\Files\Driver->getPath()
#2 /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php(79): Phpfastcache\Drivers\Files\Driver->driverCheck()
#3 /var/www/html/core/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/C" while reading response header from upstream, client: 10.0.0.1, server: 127.0.0.1, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "127.0.0.1"
As permissões do diretório são:
[[email protected] cache]# ls -laF
total 12
drwxr-xr-x. 2 nginx nginx 4096 Jun 19 00:23 ./
drwxr-xr-x. 11 nginx nginx 4096 Jun 18 23:55 ../
O servidor está configurado com:
- Nginx 1.20.1
- PHP 8.3.8
- phpfastcache 9.2.*
- Usando PHP-FPM
- Tudo rodando sob
nginx
o usuário