E-Mails are successfully send by Swiftmailer, but only during normal runtime. When sending log messages during "register_shutdown_function", PHP mail() fails. This is a restriction of my shared hosting environment, which resets the current working directory to the root (/) before shutdown functions are called.
In order to send mails during "register_shutdown_function", I have to manually change the working directory back to my www-root. How can I achieve this? Is it possible to extend Yii so that it automatically sets the working directory during register_shutdown_function back to the default Yii directory?
I confirmed such behavior of shutdown function but unable to reproduce any problems so far. Do you have any details about the problem? Any extra errors in logs etc. i.e. any idea what doesn’t work exactly?
I cannot give you an error log, because no errors are reported. It is a restriction of my hoster (http://www.hosteurope.de). You can find (a german) description here.
At the end of the page, you can find the statement, that I can only access /usr/sbin/sendmail or mail() if the working directory is /is/htdocs/wpXXXXX_YYYY/ or below (user specific root) but not from the server root /.
So my question is, is it possible to instruct Yii that it keeps the directory from which the start script was called when entering the shutdown procedure?