From:             ian at onlineloop dot com
Operating system: Solaris 10
PHP version:      5.2.5RC1
PHP Bug Type:     Unknown/Other Function
Bug description:  Occasionally PHP can't execute external programs and can't 
open files

Description:
------------
Working with PHP 5.2.5-RC2, build from php5.2-200710241430, problem also
occurred in php5.2-200710171030.

PHP for what ever reason is occasionally unable to execute the mail
program that we have installed, ssmtp. I am able to run the script below
15-20 times, and 1 or 2 times the mail program fails, every other time it
is successful. This problem seesm to occur only when there is a higher
system load, apache needs to be serving 60-80 requests before this problem
shows itself. Suspicion was in the maximum number of open files, however
that can be ruled out as our system (Sun V440, 16Gb RAM, 4 x SPARC 1.6Ghz)
allows up to 10240 open files at any one time.

Additionally, there are sometimes problems creating files. Although the
errors would point to a system problem, this is definately not the case as
other processes on the system do not have problems (proftpd, for example),
and everything was OK with PHP 5.1.6.

A log file extract and system messages are:
# Oct 25 16:28:01 www-walda mod_evasive[21333]: [ID 869489 daemon.alert]
Couldn't open logfile /var/apache2/logs/mod_evasive-log/dos-86.56.222.150:
Bad file number

[25-Oct-2007 16:39:48] [UseBB Error] [Thu Oct 25 14:39:48 2007] [E_WARNING
- mb_send_mail() [<a
href='function.mb-send-mail'>function.mb-send-mail</a>]: Could not execute
mail delivery program '/usr/bin/ssmtp -t'] [./sources/functions.php:1164]

[25-Oct-2007 16:30:03] PHP Warning:  mail() [<a
href='function.mail'>function.mail</a>]: Could not execute mail delivery
program '/usr/bin/ssmtp -t' in /ftp/usr/ian/mailtest.php on line 12

These problems have appeared only since we changed from PHP 5.1.6 to PHP
5.2.x (note that we have had many problems with PHP 5.2.x). We are
currently using the PHP CVS version mentioned above, as up until and
including PHP 5.2.4, bug numbers 41822, 41899 were blocking us.

Reproduce code:
---------------
<?php
// Mail addresses have been removed because of spam concerns!
 $to      = '<enter your mail address here';
 $subject = 'the testmail';
 $message = 'Testmail' ;
 $headers = 'From: <senders mail address>' . "\r\n" .
    'Reply-To: <senders mail address>' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

$date= date("d M y, G:i:s");

if ( mail($to, $subject, $message, $headers) == TRUE)
        echo "OK: $date, mail($to, $subject, $message, $headers)";
else
        echo "False";
?>


Expected result:
----------------
The code should run correctly every time, delivering a mail.

Actual result:
--------------
The mail is sent most times, but occasionally I get an error message back
saying that the sending failed:

Browser:
Warning: mail() [function.mail]: Could not execute mail delivery program
'/usr/bin/ssmtp -t' in /ftp/usr/ian/mailtest.php on line 12
 False

Logs:
[25-Oct-2007 16:56:58] PHP Warning:  mail() [<a
href='function.mail'>function.mail</a>]: Could not execute mail delivery
program '/usr/bin/ssmtp -t' in /ftp/usr/ian/mailtest.php on line 12


-- 
Edit bug report at http://bugs.php.net/?id=43105&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43105&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43105&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43105&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43105&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43105&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43105&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43105&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43105&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43105&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43105&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43105&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43105&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43105&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43105&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43105&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43105&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43105&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43105&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43105&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43105&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43105&r=mysqlcfg

Reply via email to