Problem with mail() on Debian

Problem with mail() on Debian

am 22.02.2006 08:52:18 von George.Pitcher

Hi,

I am in the process of moving from Windows (NT/XP) to Linux. I'm starting
with a new small application which I have working on my Windows XP laptop.

On my Linux box, I have php.ini saying:

sendmail_path /usr/sbin/sendmail

That 'sendmail' is a symbolic link to exim4 in the same directory. I can
send mail using exim4 from the command line, but not using PHP. I couldn't
find anything in the manual or on Google that helps me solve the problem.

Can anyone give me a clue where to look to solve this problem?

Cheers

George, in Oxford

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem with mail() on Debian

am 22.02.2006 20:00:58 von Jochem Maas

George Pitcher wrote:
> Hi,
>
> I am in the process of moving from Windows (NT/XP) to Linux. I'm starting
> with a new small application which I have working on my Windows XP laptop.
>
> On my Linux box, I have php.ini saying:

search this page for 'exim' - it should help:

http://php.net/mail

>
> sendmail_path /usr/sbin/sendmail

this may need to become:

sendmail_path /usr/sbin/sendmail -t

and it may require quotes:

sendmail_path "/usr/sbin/sendmail -t"

>
> That 'sendmail' is a symbolic link to exim4 in the same directory. I can
> send mail using exim4 from the command line, but not using PHP. I couldn't
> find anything in the manual or on Google that helps me solve the problem.
>
> Can anyone give me a clue where to look to solve this problem?
>
> Cheers
>
> George, in Oxford
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Problem with mail() on Debian

am 23.02.2006 07:55:53 von George.Pitcher

Jochem,

Thanks, but I tried that and it made no difference.

I have found that any changes I make to php.ini are ignored, even after
restarting Apache. I have been editing httpd.conf via Webmin, which for most
configs works fine (and is displayed in phpinfo(), the sendmail changes are
never displayed (always shows sendmail_path = /usr/sbin/sendmail).

Cheers

George

> -----Original Message-----
> From: Jochem Maas [mailto:jochem@iamjochem.com]
> Sent: 22 February 2006 7:01 pm
> To: George Pitcher; [php] PHP General List
> Subject: Re: [PHP] Problem with mail() on Debian
>
>
> George Pitcher wrote:
> > Hi,
> >
> > I am in the process of moving from Windows (NT/XP) to Linux.
> I'm starting
> > with a new small application which I have working on my Windows
> XP laptop.
> >
> > On my Linux box, I have php.ini saying:
>
> search this page for 'exim' - it should help:
>
> http://php.net/mail
>
> >
> > sendmail_path /usr/sbin/sendmail
>
> this may need to become:
>
> sendmail_path /usr/sbin/sendmail -t
>
> and it may require quotes:
>
> sendmail_path "/usr/sbin/sendmail -t"
>
> >
> > That 'sendmail' is a symbolic link to exim4 in the same directory. I can
> > send mail using exim4 from the command line, but not using PHP.
> I couldn't
> > find anything in the manual or on Google that helps me solve
> the problem.
> >
> > Can anyone give me a clue where to look to solve this problem?
> >
> > Cheers
> >
> > George, in Oxford
> >
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem with mail() on Debian

am 23.02.2006 08:08:07 von Manuel Lemos

Hello,

on 02/23/2006 03:55 AM George Pitcher said the following:
> Jochem,
>
> Thanks, but I tried that and it made no difference.
>
> I have found that any changes I make to php.ini are ignored, even after
> restarting Apache. I have been editing httpd.conf via Webmin, which for most
> configs works fine (and is displayed in phpinfo(), the sendmail changes are
> never displayed (always shows sendmail_path = /usr/sbin/sendmail).

There are no miracles. If you change restarted Apache and phpinfo()
shows the same in sendmail_path, either you have other Apache
configuration changing PHP options, or you have not really changed
php.ini, which is very likely.

No, I am not saying you are crazy. It is very likely that the real
php.ini is not in the path you think it is. This may happen if you have
installed Zend Studio or some other tool that needs to replace the real
php.ini and moves it elsewhere.

Look again to the phpinfo() output to determine the real path of php.ini .

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Problem with mail() on Debian

am 23.02.2006 08:13:52 von George.Pitcher

Manuel,

> > I have found that any changes I make to php.ini are ignored, even after
> > restarting Apache. I have been editing httpd.conf via Webmin,
> which for most
> > configs works fine (and is displayed in phpinfo(), the sendmail
> changes are
> > never displayed (always shows sendmail_path = /usr/sbin/sendmail).
>
> There are no miracles. If you change restarted Apache and phpinfo()
> shows the same in sendmail_path, either you have other Apache
> configuration changing PHP options, or you have not really changed
> php.ini, which is very likely.
>
> No, I am not saying you are crazy. It is very likely that the real
> php.ini is not in the path you think it is. This may happen if you have
> installed Zend Studio or some other tool that needs to replace the real
> php.ini and moves it elsewhere.
>
> Look again to the phpinfo() output to determine the real path of php.ini .
>
That's the crazy part! phpinfo() shows the path to the php.ini file as the
one that I have been editing, and if I open that file in vi, it shows all
the changes I've made. This is a bare debian install in as much as it has no
windowing environments. No Zend Studio, or anything else fancy. Smarty and
PEAR work, its just the emailing that is letting me down just now. Once
that's resolved I'll move on to spreadsheet reading.

Cheers

George

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem with mail() on Debian

am 23.02.2006 15:16:58 von Jochem Maas

George Pitcher wrote:
> Manuel,
>
>
>>>I have found that any changes I make to php.ini are ignored, even after
>>>restarting Apache. I have been editing httpd.conf via Webmin,

personally I'd rather stick my head in a blender than use webmin to edit
such conf files. (no I wouldn't but you get the point hopefully)

how are you restarting apache? possibly your being told that the restart
occured but really your being lied to ... try doing it 'manually':

e.g.:

?> apachectl stop; sleep 5; apachectl start



>>
>>which for most
>>
>>>configs works fine (and is displayed in phpinfo(), the sendmail
>>
>>changes are
>>
>>>never displayed (always shows sendmail_path = /usr/sbin/sendmail).

until the sendmail_path changes when you view
phpinfo() your updated php.ini has not been read in - for whatever
reason.

>>
>>There are no miracles. If you change restarted Apache and phpinfo()
>>shows the same in sendmail_path, either you have other Apache
>>configuration changing PHP options, or you have not really changed
>>php.ini, which is very likely.
>>
>>No, I am not saying you are crazy. It is very likely that the real
>>php.ini is not in the path you think it is. This may happen if you have
>>installed Zend Studio or some other tool that needs to replace the real
>>php.ini and moves it elsewhere.
>>
>>Look again to the phpinfo() output to determine the real path of php.ini .
>>
>
> That's the crazy part! phpinfo() shows the path to the php.ini file as the
> one that I have been editing, and if I open that file in vi, it shows all
> the changes I've made. This is a bare debian install in as much as it has no
> windowing environments. No Zend Studio, or anything else fancy. Smarty and
> PEAR work, its just the emailing that is letting me down just now. Once
> that's resolved I'll move on to spreadsheet reading.
>
> Cheers
>
> George
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Problem with mail() on Debian

am 23.02.2006 15:32:44 von George.Pitcher

Jochem,

>
> personally I'd rather stick my head in a blender than use webmin to edit
> such conf files. (no I wouldn't but you get the point hopefully)
>
> how are you restarting apache? possibly your being told that the restart
> occured but really your being lied to ... try doing it 'manually':
>
> e.g.:
>
> ?> apachectl stop; sleep 5; apachectl start


Webmin was a means to an end. Your restarting method solved the problem of
php.ini being read (or at least being displayed in phpinfo()), but doesn't
get round my email problem.

My apache error.log says:

sh: line 1: /usr/sbin/sendmail -t: no such file or directory

if I replace sendmail with exim4, i get an equivalent error.

ls -l sendmail in /usr/sbin gives me:
lrwxrwxrwx 1 root root 5 2005-11-17 15:51 sendmail -> exim4

Any (constructive) thoughts?

Cheers

George

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem with mail() on Debian

am 23.02.2006 15:40:24 von John Nichel

George Pitcher wrote:
> Jochem,
>
>> personally I'd rather stick my head in a blender than use webmin to edit
>> such conf files. (no I wouldn't but you get the point hopefully)
>>
>> how are you restarting apache? possibly your being told that the restart
>> occured but really your being lied to ... try doing it 'manually':
>>
>> e.g.:
>>
>> ?> apachectl stop; sleep 5; apachectl start
>
>
> Webmin was a means to an end. Your restarting method solved the problem of
> php.ini being read (or at least being displayed in phpinfo()), but doesn't
> get round my email problem.
>
> My apache error.log says:
>
> sh: line 1: /usr/sbin/sendmail -t: no such file or directory
>
> if I replace sendmail with exim4, i get an equivalent error.
>
> ls -l sendmail in /usr/sbin gives me:
> lrwxrwxrwx 1 root root 5 2005-11-17 15:51 sendmail -> exim4
>
> Any (constructive) thoughts?

Permissions on exim4?

Oh, and don't use Webmin. ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel@dotcomholdingsofbuffalo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem with mail() on Debian

am 23.02.2006 20:57:44 von Manuel Lemos

Hello,

on 02/23/2006 11:32 AM George Pitcher said the following:
> My apache error.log says:
>
> sh: line 1: /usr/sbin/sendmail -t: no such file or directory

/usr/sbin/sendmail is not the correct sendmail program path. The correct
path is /usr/lib/sendmail . It may be odd that a program is located in
/usr/lib but that has always been the standard path for sendmail and
compatible MTA. Sometimes it is a symbolic link to /usr/sbin/sendmail
but that is not necessarily true.

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[SOLVED] Problem with mail() on Debian

am 24.02.2006 13:14:31 von George.Pitcher

Hi,

Thanks to David - his suggestion to comment out the php.ini sendmail_path
line and reverting to using Manuel's email class solved the problem.

Many thanks to all.

George

> -----Original Message-----
> From: Manuel Lemos [mailto:mlemos@acm.org]
> Sent: 23 February 2006 7:58 pm
> To: php-general@lists.php.net
> Subject: Re: [PHP] Problem with mail() on Debian
>
>
> Hello,
>
> on 02/23/2006 11:32 AM George Pitcher said the following:
> > My apache error.log says:
> >
> > sh: line 1: /usr/sbin/sendmail -t: no such file or directory
>
> /usr/sbin/sendmail is not the correct sendmail program path. The correct
> path is /usr/lib/sendmail . It may be odd that a program is located in
> /usr/lib but that has always been the standard path for sendmail and
> compatible MTA. Sometimes it is a symbolic link to /usr/sbin/sendmail
> but that is not necessarily true.
>
> --
>
> Regards,
> Manuel Lemos
>
> Metastorage - Data object relational mapping layer generator
> http://www.metastorage.net/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php