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.

Community
  • 1
  • 1
bryman79
  • 383
  • 1
  • 13

0 Answers0