Please describe the issue thoroughly enough so that anyone can reproduce the exact behavior youâre seeing. Be as specific as possible.
my Caddyfile shown above, but php only work at the default site, the site ooxx.net not work. The log files reads.
How to make php work for the site ooxx.net? Further more ,is there any way to make settings like php and gzip to be public for all sites?
4. Error messages and/or full log output:
Please DO NOT REDACT any information except passwords/keys.
[ERROR 0 /index.php] PHP message: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /var/www/ooxx.net/index.php (Permission denied)
5. What I already tried:
the user, and the listener of php-fpm service has been set to www-data, the same as the Caddy service.
The owner of the directory /var/www/html and /var/www/ooxx.net have been set to www-data.
I use to chmod the php files in the dir ooxx.net to 0777. But the permission still denied.
sorry, i cannot quite follow the meaning of âunit fileâ⌠@Whitestrake
i havent tried other webservers at this vps before, since to me oracle linux is a little bit⌠awesome. For apache the php support is configured auto at the debian-like linux and always ok, so i think there is something wrong with my own settings.
# /usr/lib/systemd/system/php-fpm.service
# It's not recommended to modify this file in-place, because it
# will be overwritten during upgrades. If you want to customize,
# the best way is to use the "systemctl edit" command.
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=notify
ExecStart=/usr/sbin/php-fpm --nodaemonize
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
RuntimeDirectory=php-fpm
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
[ERROR 0 /index.php] PHP message: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /var/www/ooxx.net/index.php (Permission denied)
The fact that we have an error here from PHP means that Caddy is properly configured and is passing requests off to PHP-FPM and getting responses back. So thereâs nothing here to fix in the Caddyfile, itâs already working.
The issue is that PHP doesnât seem to be configured with the right permissions to access the files. Something is denying permissions. I donât see systemd doing anything along those lines, so possibly itâs an issue with the PHP-FPM configuration, but Iâm not sure.
I donât know whyâŚI chmod -R the ooxx.net to 0777 and it is still not OK.
Finally I deleted the directory ooxx.net and rmdir again⌠it worksăăă