Running PHP script from procmail: Error loading shared libra…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bill Jonas
Date:  
To: plug-discuss
Subject: Running PHP script from procmail: Error loading shared libraries
Hi all,

I'm trying to execute a PHP script from procmail, but I get the
following in my procmail log file:

-------
>From Mon Feb 6 21:53:36 2006

 Subject: test
  Folder: /path/to/m2f_import_msgs.sh                                      1474
/usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
-------


This is from a package for phpBB called Mail2Forum; it basically helps
the web board also act like a mailing list. I wasn't the one who set it
up, but I'm trying to get it running on a different host. (The mail
messages were getting imported a different, messier way before.)

Here is the script itself (stripped of extraneous comments):

-------
#!/usr/local/bin/php -q
<?php
include('m2f_import_msgs.php');
?>
-------

And here's the .procmailrc:

-------
PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
LOGFILE=$HOME/tmp/procmail.log #recommended

:0
* ^TO.*address@domain
|/path/to/m2f_import_msgs.sh
-------

I'd only set the path as part of troubleshooting. Also,
libmysqlclient.so.15{,.0.0} is in /usr/lib, which ld.so(8) says is in
the default library search path (along with /lib). I'd tried setting
LD_LIBRARY_PATH=/usr/lib/, which helped for a bit (and it successfully
imported messages), but then it mysteriously broke again for no reason.
I had limited success by changing m2f_import_msgs.sh to this:

-------
#!/bin/bash

/usr/local/bin/php -q /path/to/m2f_import_msgs.php
-------

However, it was only successful one time before breaking again.

I can successfully run the script all day long from the command line. I
can't seem to find any significant differences between the two
environments. (TERMCAP, for example, is set in the interactive shell,
but that shouldn't make any difference, right?) I also don't have root
access to this server as it's a shared host, but it's running Debian
sarge. uname reports the kernel version as
"2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+++686+c6+gr6b-v6.192", if that
helps. :-)

Anyone have a cluebat?

-- 
Bill Jonas    *        *    http://www.billjonas.com/
"It's a dangerous business, Frodo, going out your front door.  You step
into the Road,  and if you don't keep your feet,  there  is  no knowing
where you might be swept off to."  --  Bilbo Baggins
---------------------------------------------------
PLUG-discuss mailing list - 
To subscribe, unsubscribe, or to change  you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss