php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7637 Mail() fails in mod_php, not in standalone php
Submitted: 2000-11-04 05:28 UTC Modified: 2000-12-15 11:03 UTC
From: martin at douda dot net Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.3pl1 OS: RH Linux 6.2, kernel2.2.17+reise
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: martin at douda dot net
New email:
PHP Version: OS:

 

 [2000-11-04 05:28 UTC] martin at douda dot net
I have this test script:
<?

$res=Mail("martin@douda.net","test","just a test");
printf("%d",$res);

?>

If I run this script in standalone php, it sends a mail to me as expected, but if I run this via apache module mod_php,
the function mail() fails (returns 0). Even when error_reporting is set to 15, it does not report any error.
Both standalone and moduled phps are using same configuration file. I have tested 
sendmail_path="/usr/sbin/sendmail -t" and not setting sendmail_path at all, both showing same behavior.
And of course, I've restarted apache each time I've changed php configuration.

I have tried replacing sendmail binary with my test script, 
which have shown that sendmail is not run at all for some reason.



My php configuration:
;; EXTENSION LOADING
extension_dir   =       /usr/lib/php4

;; Global PHP defaults

warn_plus_overloading   =       On      ; warn if the  operator is used with strings
track_errors            =       On      ; Store the last error/warning message in $php_errormsg (boolean)
track_vars              =       On      ; enable the $HTTP_*_VARS[] arrays, where * is one of

magic_quotes_gpc        =       On      ; magic quotes for incoming GET/POST/Cookie data
                                        ; many people think that the system is a pain in the
                                        ; a**, but it probably does represent a security 
                                        ; feature for in-experienced PHP developers. Turn it
                                        ; off if you don't want PHP to mess with your incoming
                                        ; variables.
include_path    = ".:/usr/share/php"
session.save_path = "/var/state/php"
extension=mysql.so

error_reporting = 15

display_errors = Off

error_log = syslog

log_errors = On

sendmail_path = "/usr/sbin/sendmail -t"


And compile-time configuration:
Configure Command
                                                                                     './configure' '--prefix=/usr' '--with-apxs' '--libdir=/usr/lib/php4'
                                                                                     '--includedir=/usr/include' '--datadir=/usr/share/php' '--with-config-file-path=/etc'
                                                                                     '--enable-inline-optimization' '--enable-magic-quotes' '--enable-track-vars'
                                                                                     '--enable-memory-limit' '--enable-wddx' '--enable-sysvsem=shared'
                                                                                     '--enable-sysvshm=shared' '--with-xml' '--with-gd=shared' '--with-ttf'
                                                                                     '--enable-ftp' '--with-readline=shared' '--with-mm' '--with-mysql=shared'
                                                                                     '--with-ldap=shared' '--with-imap=shared' '--with-zlib' '--with-pgsql=shared'
                                                                                     '--with-interbase=shared' '--with-dbase=shared' '--with-gettext=shared'
                                                                                     '--with-pspell=shared' '--enable-calendar=shared' '--with-snmp=shared'
                                                                                     '--enable-ucd-snmp-hack' '--with-sybase-ct=shared,/usr/freetds'
                                                                                     '--with-pdflib=shared'


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-12 11:09 UTC] sniper@php.net
What does this print out:

# ls -l /usr/sbin/sendmail

 This is my output:
-rwsr-sr-x    1 root     root       320516 Nov 12 17:50 /usr/sbin/sendmail

and mail() works for me. (in mod_php)

--Jani
 [2000-11-12 11:09 UTC] sniper@php.net
status->feedback
 [2000-12-15 11:03 UTC] sniper@php.net
no feedback.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC