php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20751 Mail: undefined function
Submitted: 2002-12-01 15:33 UTC Modified: 2002-12-12 13:44 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: busia at tiscali dot it Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.3.0RC2 OS: Linux Redhat 7.2
Private report: No CVE-ID: None
 [2002-12-01 15:33 UTC] busia at tiscali dot it
If I try to use the mail function I receive this error:

PHP Fatal error:  Call to undefined function:  mail() in /home/httpd/html/bug.php on line 2

the script bug.php is

<?
mail("andrea.busia@ludus.com", "busia", "busia");
echo "a";
?>

Before the upgrade to 4.3.RC2 the mail function was working well.

The server configuration is

Redhat 7.2
Apache 1.3.22
PHP 4.3.0RC2
Mysql 4.0.5
Qmail 1.03

Andrea Busia

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-01 16:14 UTC] sniper@php.net
Does the user you're compiling PHP as have rights to access the sendmail binary on your system?

 [2002-12-01 16:25 UTC] busia at tiscalinet dot it
The same problem is also on an other server with a similar configuration (but with redhat 7.0):

The the servers config.log says:
--------------------------------
configure:10743: checking for sendmail
configure:10776: result: no
--------------------------------

Why? Qmail is installed, seems that the new php version doesn't find it but 4.2.3 did!
 [2002-12-01 16:28 UTC] sniper@php.net
Does the user you're compiling PHP as have rights to access the sendmail binary on your system?

(qmail does add some wrapper binary for sendmail, and it works fine here..)

 [2002-12-01 16:42 UTC] busia at tiscalinet dot it
Yes. The user is root.
 [2002-12-01 16:45 UTC] busia at tiscalinet dot it
Qmail is configured with virtual links from:

/sbin/sendmail
/usr/sbin/sendmail
/usr/lib/sendmail

to /var/qmail/bin/sendmail

as suggested in qmail documentation
 [2002-12-01 17:00 UTC] sniper@php.net
Try this on your cmd line:

# test -f /sbin/sendmail && echo "works"

(it should print 'works')

 [2002-12-02 03:04 UTC] busia at tiscalinet dot it
Yes, it works.
 [2002-12-02 10:55 UTC] busia at tiscalinet dot it
I have resolved the problem adding a symbolic link from /var/qmail/bin/sendmail to /usr/bin/sendmail and now it works.

The configure script doesn't search in /usr/sbin but only in /usr/bin. Please correct this problem
 [2002-12-02 12:19 UTC] derick@php.net
It does already search there:
AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib)

What does config.log say about sendmail when you remove that link again?
 [2002-12-02 15:48 UTC] busia at tiscalinet dot it
If I remove the link the config doesn't find sendmail.
 [2002-12-02 16:24 UTC] derick@php.net
What does config.log say about sendmail when you remove that link again?

 [2002-12-02 16:56 UTC] sh at sam dot sh
I'm also experiencing this problem, same version, same os. I'll try the symbolic link workaround.
 [2002-12-02 17:09 UTC] sh at sam dot sh
Yup, looks like that solved the problem for me, just waiting for the build to finish. Build finished, all ok. So it seems to not check /usr/sbin for sendmail, only /usr/bin.
 [2002-12-03 00:31 UTC] derick@php.net
Okay, let me try one more time:

What does config.log say about sendmail when you don't make that symlink? I'd like to see WHY it fails, not THAT it fails, cause we already know this.

Derick
 [2002-12-03 05:53 UTC] busia at tiscalinet dot it
from config.log
--------------------------
configure:10743: checking for sendmail
configure:10776: result: no
--------------------------

Andrea Busia
 [2002-12-03 06:15 UTC] msopacua@php.net
In configure, what is the value of this variable:
as_executable_p
(find out by `grep ^as_executable_p ./configure')

Then try that on your symlink. IE:
with my configure it's set of "test -f", so try:
if test -f /usr/sbin/sendmail; then echo yes; fi


 [2002-12-03 06:48 UTC] busia at tiscalinet dot it
It works well

but the previous config.log section is without the symlink (as requested) in /usr/bin/sendmail but only in /usr/sbin and /usr/lib

with the symlink all works well.
 [2002-12-03 06:59 UTC] msopacua@php.net
I'll rephrase, y'honnor:
Does:
if test -f /usr/sbin/sendmail; then echo yes; fi
Produce:
"yes"

Please note: /usr/sbin/sendmail - not /usr/bin/sendmail.
 [2002-12-03 08:53 UTC] busia at tiscalinet dot it
Yes, it produces "yes"

Andrea Busia
 [2002-12-05 12:02 UTC] busia at tiscali dot it
Yes, it produces "yes"

Andrea Busia
 [2002-12-05 12:12 UTC] msopacua@php.net
Could you gzip config.log and configure and mail them to me?
 [2002-12-08 14:30 UTC] oden dot eriksson at linux-mandrake dot com
Hi.

This works:

export PROG_SENDMAIL="/var/qmail/bin/sendmail"

(but it's a workaround)
 [2002-12-12 13:44 UTC] msopacua@php.net
Thanx for your help.

This is actually a bug in autoconf-2.53, which was used to build RC2.
RC3, which came out yesterday, doesn't have this problem.

The problem only manifests itself, when sendmail is NOT in your path, because autoconf-2.53 generates the wrong shellcode.

So a work-around, is to adjust your path, so that sendmail is in there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC