Connecting Tech Pros Worldwide Forums | Help | Site Map

SuSE 9.1 - mail() function disabled in PHP ??

Data Goob
Guest
 
Posts: n/a
#1: Jul 17 '05
This one has me stumped.

How did SuSE disable the mail() function in their RPM'd version of PHP?
( This is their install-version of PHP with RPMs not what you download
from PHP.net )

I have an application that emails people a message, and now having installed
my PHP application on my customer's machine it doesn't work, giving an error
message that the mail() function is not defined.

I'd like to know if it's something in the config on the machine that I can
simply turn it on, or do I need to simply recompile PHP? I'd like to not
have to recompile PHP as SuSE have already saved me a lot of work. Typically
I compile PHP and Apache but want to keep this machine as out-of-the-box.

Here's their config:

'./configure' '--prefix=/usr' '--datadir=/usr/share/php'
'--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share'
'--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib'
'--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin'
'--disable-debug' '--enable-inline-optimization' '--enable-memory-limit'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild'
'--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli'
'--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork'
'i586-suse-linux'

I'm using sessions just fine too, despite the configure directives.

Help!

:-)

-DG-


Pjotr Wedersteers
Guest
 
Posts: n/a
#2: Jul 17 '05

re: SuSE 9.1 - mail() function disabled in PHP ??


Data Goob wrote:[color=blue]
> This one has me stumped.
>
> How did SuSE disable the mail() function in their RPM'd version of
> PHP? ( This is their install-version of PHP with RPMs not what you
> download from PHP.net )
>
> I have an application that emails people a message, and now having
> installed my PHP application on my customer's machine it doesn't
> work, giving an error message that the mail() function is not defined.
>
> I'd like to know if it's something in the config on the machine that
> I can simply turn it on, or do I need to simply recompile PHP? I'd
> like to not have to recompile PHP as SuSE have already saved me a lot
> of work. Typically I compile PHP and Apache but want to keep this
> machine as out-of-the-box.
> Here's their config:
>
> './configure' '--prefix=/usr' '--datadir=/usr/share/php'
> '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share'
> '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib'
> '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin'
> '--disable-debug' '--enable-inline-optimization'
> '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode'
> '--enable-sigchild' '--disable-ctype' '--disable-session'
> '--without-mysql' '--disable-cli' '--without-pear' '--with-openssl'
> '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux'
>
> I'm using sessions just fine too, despite the configure directives.
>[/color]
Dunno why the sessions work regardless of config, but...
If safe mode is enabled, restrictions apply to what system commands and
programs can be spawned/started from PHP, see
http://nl.php.net/manual/en/features...#ini.safe-mode

Perhaps here you'll find something useful ? HTH
Pjotr


Manuel Lemos
Guest
 
Posts: n/a
#3: Jul 17 '05

re: SuSE 9.1 - mail() function disabled in PHP ??


Hello,

On 10/10/2004 05:26 PM, Data Goob wrote:[color=blue]
> How did SuSE disable the mail() function in their RPM'd version of PHP?
> ( This is their install-version of PHP with RPMs not what you download
> from PHP.net )
>
> I have an application that emails people a message, and now having
> installed
> my PHP application on my customer's machine it doesn't work, giving an
> error
> message that the mail() function is not defined.
>
> I'd like to know if it's something in the config on the machine that I can
> simply turn it on, or do I need to simply recompile PHP? I'd like to not
> have to recompile PHP as SuSE have already saved me a lot of work.[/color]

This happens when the configure script is not able to find the sendmail
executable . Usually it happens when the configure script is run by
another user besides root, but RPM installation seems not be the case.

Meanwhile I got some reports by other users telling me that the mail
function is disabled on their systems despite the sendmail executable is
in place. I suspect it is a bug in PHP build system.

You may want to take a look at phpinfo() function output and see what
sendmail_path option says and check whether the sendmail executable
exists on the specified path.



--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Data Goob
Guest
 
Posts: n/a
#4: Jul 17 '05

re: SuSE 9.1 - mail() function disabled in PHP ??


Manuel,

Thanks for this information, and thanks also to Pjotr, you both have
been very helpful.

I checked the sendmail setting, grepped for disable, all that jazz,
and seeing as how it was a customer's machine, had limited time to
screw around with getting things working. Very disappointed in the
SuSE 9.1 Professional RPMs, because they save me a lot of time not
having to compile everything. The disappointment is in mail() not
working. This was the very thing I needed working.

So I went and compiled Apache 2.0.52, and php 4.3.9, and
they are working correctly. But it now means there's two PHP's and
two Apache2 versions of servers on the system. Mine went into
/usr/local/apache2 and defaults for PHP simply because I couldn't
risk overlaying the RPM version in the event the compiled version
had problems. I wish SuSE would follow the defaults so that
compiled-upgrades will overlay older releases without a lot of
hunting for the settings and configs. The configs from the RPMs
were no good to me, plus SuSE went nuts with cutting up the
httpd.conf in to Includes, to make it even more time consuming
trying to figure out where everything is. It was a great idea
but a real pain in the ass.

Anyway... THANKS!

-DG-

Manuel Lemos wrote:[color=blue]
> Hello,
>
> On 10/10/2004 05:26 PM, Data Goob wrote:
>[color=green]
>> How did SuSE disable the mail() function in their RPM'd version of PHP?
>> ( This is their install-version of PHP with RPMs not what you download
>> from PHP.net )
>>
>> I have an application that emails people a message, and now having
>> installed
>> my PHP application on my customer's machine it doesn't work, giving an
>> error
>> message that the mail() function is not defined.
>>
>> I'd like to know if it's something in the config on the machine that I
>> can
>> simply turn it on, or do I need to simply recompile PHP? I'd like to not
>> have to recompile PHP as SuSE have already saved me a lot of work.[/color]
>
>
> This happens when the configure script is not able to find the sendmail
> executable . Usually it happens when the configure script is run by
> another user besides root, but RPM installation seems not be the case.
>
> Meanwhile I got some reports by other users telling me that the mail
> function is disabled on their systems despite the sendmail executable is
> in place. I suspect it is a bug in PHP build system.
>
> You may want to take a look at phpinfo() function output and see what
> sendmail_path option says and check whether the sendmail executable
> exists on the specified path.
>
>
>[/color]

Manuel Lemos
Guest
 
Posts: n/a
#5: Jul 17 '05

re: SuSE 9.1 - mail() function disabled in PHP ??


Hello,

On 10/11/2004 07:51 PM, Data Goob wrote:[color=blue]
> I checked the sendmail setting, grepped for disable, all that jazz,
> and seeing as how it was a customer's machine, had limited time to
> screw around with getting things working. Very disappointed in the
> SuSE 9.1 Professional RPMs, because they save me a lot of time not
> having to compile everything. The disappointment is in mail() not
> working. This was the very thing I needed working.[/color]

It is probably not Suse's fault. You may want to contact the Suse person
that builds these RPMs so he can figure a workaround for the problem.


--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Closed Thread


Similar PHP bytes