1

I am trying to change the location of the php_mail.log file which is automatically placed in the root directory when sending email using the PHP mail() function. My website is hosted on a shared server at Siteground. phpinfo() shows a local value of "php_mail.log" (no path) for the mail.log directive.

I tried changing the location (to a folder named "mail-log" outside the root directory) by adding the following to the php.ini file ("usr" was replaced by the proper username):

mail.log = /home/usr/mail-log/php_mail.log

However, this seemed to be ignored as the php_mail.log file was still placed in the root directory.

A similar post (here: PHP mail: how to override or bypass mail.log setting) indicates that the location can be changed using the php.ini file. However, as I noted, it seems to have no effect.

Is it possible that a server setting is overriding the change in the php.ini file? I contacted Siteground, but they were not helpful. Any insight or suggestions would be appreciated.

2
  • You'd have to have apache restarted to apply the settings.. Commented Nov 18, 2016 at 22:20
  • According to Siteground support, it doesn't sound like it is possible for me to restart Apache. Is there another way? Commented Nov 19, 2016 at 1:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.