Control Web Panel
WebPanel => PHP => Topic started by: dbmtr on January 03, 2022, 07:24:37 PM
-
Hi All,
have following error "mail(/usr/local/apache/logs/phpmail.log): failed to open stream: Read-only file system"
should I change the log file permissions or should it happen automatically during the php-fpm build?
Best regards.
-
Having the same problem since I switched to php-fpm.
How to fix this?
-
Permission for this file on my system is:
-rw-rw-rw-. root root
-
They already are - 777. 0 0
-
As root, do:
touch /usr/local/apache/logs/phpmail.log
See if you get an error
-
check the file /lib/systemd/system/php-fpm[version].service
Look for the line: ProtectSystem=
Make sure it is set to false.
run the command " systemctl daemon-reload ", then restart php-fpm[version]
-
That second suggestion seems to be a possible solution because read-only file system cannot be worked around with Unix permissions (chmod).
But is that a safe solution? If not, what are other options?
-
It's either that, or change the location of the phpmail.log to /var/log/php/phpmail.log
Either option would be fine, but the second would be most secure.