Recently, I ' ve been playing around with some stuff-uses mail () in PHP, and I know I ' ve hit errors to the past when I ' ve set PhpBB to use the mail () function, and I never really figured out why the all case is failing. It started when I got the real error from PHP (when another program called Mail ())--"PHP Fatal error:call to undefined function mail () "--looking around for a bit, I found that there are a few things the can cause this. One is simply PHP can ' t find SendMail, so you need to point it's right direction using the ' sendmail_path ' option in PHP.ini. If that's fails to work, you ' re going to have to do a bit more work. Create a new. php file (for example, phpinfo.php), with only "<?php phpinfo ()?>" (without quotes) in it. Upload this to your server, and view it with your Web browser. Look down a bit until "Sendmail_path"--I found if it broken, it usually displays "-t-i"--The default par Ameters it uses for SendMail, and nothing else. Ok, so that was kinda pointless. It doesn ' t tell us very much more. Anyway, now the real reason for creating the phpinfo () file. Please follow this steps *exactly* (or modify slightly for your setup, and you'll get the idea): Copy that entire/configure line up on the top of the Phpinfo () page--it's ll make your life much less painful, trust me. Don ' t worry about the single quotes, they ' re fine. Just leave them. Check for a working sendmail-postfix and most the other MTAs should the this, provide would qmail a provide compatible. Just Make sure there ' s something. /usr/lib/sendmail,/usr/bin/sendmail, And/usr/sbin/sendmail are good bets, as far as I know. If your sendmail is elsewhere, make a symlink back To/usr/sbin/sendmail ("Ln-s/path/to/your/sendmail/usr/sbin/sendmail ")--for qmail, that ' s" ln-s/var/qmail/bin/sendmail/usr/sbin/sendmail " Either grab the latest source of PHP, or find the source for your built PHP from (this'll require root later on, so if you ' re On a shared host, if the problem exists outside of PhpBB, and if it does, ask them. If you are are using a clean source tree, skip this step. If not, run make clean. Run the./configure line for you just copied, or if your wish, reconfigure PHP to your liking. Hey, you ' re going to redo the entire thing, why does it right? Run make, Su to root, and make install. Check php.ini (if don ' t know where it is, try "locate php.ini")--Make sure the Sendmail_path is correct. Run Apachectl Stop, followed by Apachectl start (SSL)? -If Use SSL, use STARTSSL, if not, just use start. I found that apachectl restart seems to have some strange quirks, and could just die on your after rebuilding PHP. If you can ' t find Apachectl, try "locate Apachectl" or "Whereis apachectl" to help you out. Test Mail () using a simple script. Unfortunately, I don ' t have one made. Perhaps [Url]php.net[/url] would have a idea?
That ' s it. Hope This helps someone out there!
Good luck! |