Running PHP script from procmail: Error loading shared libraries

Colin Rasor tcaz at tcaz.com
Tue Feb 7 09:56:56 MST 2006


Hi Bill,

 Check you PHP.ini file for the cli version of php. Most likely you don't
have php-mysql or mysql compiled into that version.

cat /etc/php4/cgi/php.ini |egrep mysql.so
extension=mysql.so


--Colin.ansel.Rasor



On 2/7/06 9:10 AM, "Bill Jonas" <bill at billjonas.com> wrote:

> Hi all,
> 
> I'm trying to execute a PHP script from procmail, but I get the
> following in my procmail log file:
> 
> -------
>> From bill at billjonas.com  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 at 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?




More information about the PLUG-discuss mailing list