ID:               22954
 User updated by:  mclinden at informed dot net
 Reported By:      mclinden at informed dot net
-Status:           Feedback
+Status:           Open
 Bug Type:         Mail related
 Operating System: Linux 2.4.20
 PHP Version:      4.3.1
 New Comment:

Sorry for the confusion. The last output WAS from the CLI. This is the
output from the page served up by Apache.


resource(5) of type (process) 
int(-1) 
--------------- End of script ------------/usr/sbin/sendmail: error
while loading shared libraries: libclntsh.so.9.0: cannot open shared
object file: No such file or direct


Previous Comments:
------------------------------------------------------------------------

[2003-03-30 14:43:33] [EMAIL PROTECTED]

Well then, let's try taking Apache out of the equation.

Use the CLI version of PHP (which should have been built along with the
Apache DSO module, unless you explicitly specified --without-cli) with
a simple mail script:

#!/usr/local/bin/php
<?php
  mail('[EMAIL PROTECTED]','This is another test','Still just a
test.');
?>

------------------------------------------------------------------------

[2003-03-30 11:07:27] mclinden at informed dot net

The mail is successfully sent. At the command prompt I get:

resource(7) of type (process)
int(-1)

I did NOT compile php with --with-oci8=shared,/usr/oracle/OraHome1
(well, I did, but then PHP complained that the OCI functions were
undefined).

This may be more related to apache than PHP, though I cannot think of
why.

------------------------------------------------------------------------

[2003-03-30 10:32:12] [EMAIL PROTECTED]

Try the following script (which mimicks the core of mail()'s
functionality) and reply with what is returned:

<?php
  $fd =
array(0=>array('pipe','r'),1=>array('pipe','w'),2=>array('file','proc-open.error.log','w'));

  var_dump($pid = proc_open(ini_get('sendmail_path'), $fd, $fp));

  /* Replace this with a mail address you have access to */
  fwrite($fp[0],"To: [EMAIL PROTECTED]");
  fwrite($fp[0],'Subject: This is a test. ' . date("n/j/Y H:i:s") .
"\r\n\r\n");
  fwrite($fp[0],"This is only a test.\r\n");
  fclose($fp[0]);

  while (!feof($fp[1]))
    echo fgets($fp[1]);
  fclose($fp[1]);

  var_dump(proc_close($pid));

  echo "---------------\nEnd of script\n------------\n";

  readfile('proc-open.error.log');
?>

------------------------------------------------------------------------

[2003-03-30 09:23:05] mclinden at informed dot net

I am running sendmail version 8.12.7. When I say that I can run it from
the command line I mean that if I execute at the command line the value
of sendmail_path from php.ini, it works fine. In fact, if I do an ldd
on sendmail it doesn't even NEED libclntsh.so.

Yes, libclntsh.so.9.0 exists in $ORACLE_HOME/lib and I added it to the
LD_PRELOAD environment variable for Apache.

As I said, all other services based upon PHP-Oracle work fine except
the mail command.

------------------------------------------------------------------------

[2003-03-29 20:07:51] [EMAIL PROTECTED]

(1) What version of sendmail are you running?  (Are you even running
sendmail? or a sendmail compatable MTA?)

(2) When you say "Sendmail runs fine from the command line" are you
passing a full email on stdin using the same command line switches as
specified in your php.ini?

Does libclntsh.so.9.0 exist anywhere on your system ( try: `find /
-name libclntsh.so.9.0 -print` ).  Does the path where that file is
located exist in your /etc/ld.so.conf ?  If you've just added it did
you remember to run `ldconfig`?

In any event, this is a sendmail problem and not a PHP one as PHP does
not use libclntsh itself.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22954

-- 
Edit this bug report at http://bugs.php.net/?id=22954&edit=1

Reply via email to