#30770 [NEW]: php mail() causes apache to temporarily 'crash'

From: Date: Sat, 13 Nov 2004 00:42:38 +0000
Subject: #30770 [NEW]: php mail() causes apache to temporarily 'crash'
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68994@lists.php.net to get a copy of this message
From:             chris at christopher-dean dot co dot uk
Operating system: FreeBSD 5.2.1
PHP version:      5.0.2
PHP Bug Type:     Apache2 related
Bug description:  php mail() causes apache to temporarily 'crash' 

Description:
------------
I am using php 5.0.2 with apache 2.0.52 on freebsd 5.2.1-RELEASE

whenever the mail() is invoked in a php script e.g. by clicking submit on
a mail form, apache 'crashes' (although it doesn't die completely, maybe
it restarts?) and this error of this form is produced in the logs:

www kernel: pid 20225 (httpd), uid 80: exited on signal 6

Any ideas what I can do to fix this if it isn't a bug within php itself?

Reproduce code:
---------------
<?	if(empty($_POST['name']))
		echo "The name field was empty. Please click back and fill in your
name";
	else if(empty($_POST['email']))
		echo "The email field was empty. Please click back and fill in your
email address";
	else if(empty($_POST['message']))
		echo "You did not enter a message. Please click back and write us a
message";
	else
	{
		$headers = "From: ".$_POST['name']."
<".$_POST['email'].">\r\n"
                ."reply-to:".$_POST['email']."\r\n";

		mail("example@emailaddress.com", "Message from the Media website",
$_POST['message'], $headers);	
?>
<p>Thank you for your message, we will be in contact shortly if
nessary.</p>

Expected result:
----------------
the thank you message appear on the page

Actual result:
--------------
I get the page cannot be displayed message from internet explorer
indicating apache's basically not running, but on refresh the orginal
email us submittal form comes up blank as if it has ben loaded up for the
first time (which stands to reason if apache's crashed or restarted). 

FYI: the format of the page is an 'email us' form with the form's action
being the same page, then if(isset(Submit)){...} is used execute the
mail() when sumbmited. 

-- 
Edit bug report at http://bugs.php.net/?id=30770&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30770&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30770&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30770&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30770&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30770&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30770&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30770&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30770&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30770&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30770&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30770&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30770&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30770&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30770&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30770&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30770&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30770&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30770&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30770&r=mysqlcfg


Thread (7 messages)

« previous php.bugs (#68994) next »