CodeIgniter Forums
PHP 8 - Mailhog and CI 4.1.3 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: PHP 8 - Mailhog and CI 4.1.3 (/showthread.php?tid=79789)



PHP 8 - Mailhog and CI 4.1.3 - Chroma - 07-27-2021

I've upgraded my CI4 to the latest version (4.1.3), no real problems there, and now want to use PHP 8 for future development work. So far nothing unreasonable.

However, my mailhog installation works fine with PHP 7.4.21, but the exact same code does NOT work with PHP 8.0.8.

This is perplexing. I don't know where the error is, it seems like the intercept part that mailhog performs is not happening. The mail appears to send from the mail command correctly, but nothing shows up anywhere. It's like it vanishes into the magic bitbucket.

Any thoughts would be appreciated.


RE: PHP 8 - Mailhog and CI 4.1.3 - InsiteFX - 07-27-2021

1) Check your server log
2) Check your php log
3) turn on display all for testing (make sure to turn it off when finished!)
4) echo in code is your friend.
5) use break points to monitor the code execution.


RE: PHP 8 - Mailhog and CI 4.1.3 - Chroma - 07-27-2021

Thanks.

Looking through the .ini files forced me to look at other things.

The following line was missing from the PHP 8.0 php.ini file:

sendmail_path = /usr/local/bin/mhsendmail

That was the cause of the problem.

Thanks @InsiteFX for the point in the right direction.