We have installed php4.1.2 on iplanet 6.0 Webserver on a Solaris 8 OS.
The following config options were used:
./configure' '-enable-sysvshm=yes' '--enable-sysvsem=yes'
'--with-nsapi=/ecomm/iplanet/nes60/product' '--enable-libgcc'
Something really strange is happening. I have written this piece of code
for sending e-mails.
########################################################
<?
$locat = "/usr/lib/sendmail";
$rk = "/ecomm/iplanet/nes60/product/docs/rohit/kkmail" ;
function doSending($emailFilename)
{
global $locat;
echo "<br> locat ".$locat;
echo "<br> emailfilename ".$emailFilename;
unset($do);
$do = "$locat -oi -t < $emailFilename 2>&1 ";
echo " SYSTEM " .$do;
exec($do,$ret,$ret_var);
echo "return_code " .$ret_var;
echo "reta " .$ret[1];
echo "retb " .$ret[2];
echo "retc " .$ret[3];
echo "retd " .$ret[4];
echo "rete " .$ret[5];
echo "retf " .$ret[6];
}
doSending($rk);
?>
########################################################
kkmail contents:
To: <email@testmail.com>
Line1
Line2
Line3
########################################################
The code works very well when I have:
safe_mode=off in php.ini
But as soon as I put the following parameters in php.ini and restart the
web-server:
safe_mode=on
safe_mode_exec_dir=/usr/lib
(In /usr/lib where we have the sendmail executable).
The code displays this error on the php page:
locat /usr/lib/sendmail
emailfilename /ecomm/iplanet/nes60/product/docs/rohit/kkmailSYSTEM
/usr/lib/sendmail -oi -t <
/ecomm/iplanet/nes60/product/docs/rohit/kkmail 2>&1 return_code 67
reta <... User unknown
retb /ecomm/iplanet/nes60/product/docs/rohit/kkmail... Cannot mail
directly to files
retc 2>&1... Unbalanced '>'
retd 2>&1... User unknown
rete /ecomm/iplanet/dead.letter... Saved message in
/ecomm/iplanet/dead.letter
retf
The php.ini file is like this:
########################################################
doc_root=/ecomm/iplanet/nes60/product/docs
safe_mode=on
safe_mode_exec_dir=/usr/lib
expose_php=Off
display_errors=off
log_errors=On
register_globals=off
magic_quotes_runtime=On
file_uploads=Off
allow_url_fopen=Off
session.cookie_lifetime=1200
session.cookie_path=/ecomm/iplanet/nes60/product/docs/ivor
session.entropy_length=16
session.use_trans_sid=0
session.auto_start=1
########################################################
Any help would be deeply appreciated.
Thanks,
Rohit