Php mail havent permission to phpmail.log

Started by dbmtr, January 03, 2022, 07:24:37 PM

Previous topic - Next topic

dbmtr

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.

roade

Having the same problem since I switched to php-fpm.
How to fix this?

iraqiboy90

Permission for this file on my system is:
-rw-rw-rw-. root root

roade


rcschaff

As root, do:

touch /usr/local/apache/logs/phpmail.log

See if you get an error
Google Hangouts:  rcschaff82@gmail.com

rcschaff

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]
Google Hangouts:  rcschaff82@gmail.com

roade

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?

rcschaff

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.
Google Hangouts:  rcschaff82@gmail.com