For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > July 2007 > Re: [PHP-INSTALL] help with mail() function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-INSTALL] help with mail() function
Keith Roberts

2007-07-27, 7:01 pm

What configure command did you use Bill. I've compiled php
5.2.1 on Fedora Core 6, and used the following configure
command:

'./configure'
'--with-apxs2=/usr/local/apache-2.2.0/bin/apxs'
'--prefix=/usr/local/php-5.2.1' '--enable-shared=all'
'--with-mysql=shared'
'--with-mysql-sock=/var/lib/databases/mysql/mysql.sock'
'--with-mysqli=shared'
'--with-pgsql=/usr/local/postgresql-8.2.1/bin' '--with-xsl'
'--with-zlib-dir=/usr/include'

mail() is working OK on my system.


From the manual:

LXXIX. Mail Functions
Introduction
The mail() function allows you to send mail.

Requirements
For the Mail functions to be available, PHP must have
access to the sendmail binary on your system during compile
time. If you use another mail program, such as qmail or
postfix, be sure to use the appropriate sendmail wrappers
that come with them. PHP will first look for sendmail in
your PATH, and then in the following:
/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's
highly recommended to have sendmail available from your
PATH. Also, the user that compiled PHP must have permission
to access the sendmail binary.

Installation
There is no installation needed to use these functions; they
are part of the PHP core.

Did php actually find the sendmail binary or its equivalent
when you compiled php?

Regards

Keith

On Fri, 27 Jul 2007, Bill Beck wrote:

> To: php-install@lists.php.net
> From: Bill Beck <bbeck@masshist.org>
> Subject: [PHP-INSTALL] help with mail() function
>
> Hello all,
>
> I've compiled PHP5 on an Ubuntu machine. Getting this error when trying
> to use mail(), and have looked for the obvious problems:
>
> error message:
>
> *Fatal error*: Call to undefined function mail()
>
> After running ./configure (as root) it shows that php found sendmail, and
> my admin panel confirms it's running:
>
> checking for sendmail... (cached) /usr/sbin/sendmail
>
> So sendmail is there, and the php_config.h file indeed shows #define
> HAVE_SENDMAIL 1
> but no mail function.
>
> Any thoughts?
>
> Thanks,
>
> Bill B
>


--
------------------------------------------------------------
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

This email address is challenge-response protected with
http://www.tmda.net
------------------------------------------------------------
Paul Blondé

2007-07-27, 7:01 pm

You have to be especially careful about this part, depending on your =
server
setup:

"Also, the user that compiled PHP must have permission to access the
sendmail binary."

If this is not so, the sendmail binary may have been found, but will not
work because it is not accessible, sort of an "I see you but I can't =
touch
you" situation.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paul Blond=E9



-----Original Message-----
From: Keith Roberts [mailto:keith@karsites.net]=20
Sent: Friday, July 27, 2007 9:55 AM
To: php-install@lists.php.net
Subject: Re: [PHP-INSTALL] help with mail() function


What configure command did you use Bill. I've compiled php=20
5.2.1 on Fedora Core 6, and used the following configure=20
command:

'./configure'=20
'--with-apxs2=3D/usr/local/apache-2.2.0/bin/apxs'=20
'--prefix=3D/usr/local/php-5.2.1' '--enable-shared=3Dall'=20
'--with-mysql=3Dshared'=20
'--with-mysql-sock=3D/var/lib/databases/mysql/mysql.sock'=20
'--with-mysqli=3Dshared'=20
'--with-pgsql=3D/usr/local/postgresql-8.2.1/bin' '--with-xsl'=20
'--with-zlib-dir=3D/usr/include'

mail() is working OK on my system.


>From the manual:


LXXIX. Mail Functions
Introduction
The mail() function allows you to send mail.

Requirements
For the Mail functions to be available, PHP must have=20
access to the sendmail binary on your system during compile=20
time. If you use another mail program, such as qmail or=20
postfix, be sure to use the appropriate sendmail wrappers=20
that come with them. PHP will first look for sendmail in=20
your PATH, and then in the following:=20
/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's=20
highly recommended to have sendmail available from your=20
PATH. Also, the user that compiled PHP must have permission=20
to access the sendmail binary.

Installation
There is no installation needed to use these functions; they=20
are part of the PHP core.

Did php actually find the sendmail binary or its equivalent=20
when you compiled php?

Regards

Keith

On Fri, 27 Jul 2007, Bill Beck wrote:

> To: php-install@lists.php.net
> From: Bill Beck <bbeck@masshist.org>
> Subject: [PHP-INSTALL] help with mail() function
>=20
> Hello all,
>
> I've compiled PHP5 on an Ubuntu machine. Getting this error when =

trying=20
> to use mail(), and have looked for the obvious problems:
>
> error message:
>
> *Fatal error*: Call to undefined function mail()
>
> After running ./configure (as root) it shows that php found sendmail, =

and=20
> my admin panel confirms it's running:
>
> checking for sendmail... (cached) /usr/sbin/sendmail
>
> So sendmail is there, and the php_config.h file indeed shows #define=20
> HAVE_SENDMAIL 1
> but no mail function.
>
> Any thoughts?
>
> Thanks,
>
> Bill B
>


--=20
------------------------------------------------------------
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

This email address is challenge-response protected with
http://www.tmda.net
------------------------------------------------------------
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com