Jump to content

Recommended Posts

Dear Users

 

I'm a complete PHP dunce and wondered if you guys might be able to answer what I'm sure is a very simple question...

 

I restarted my virtual server on Friday night and since then I've been getting these emails every 10 minutes (there's a Cronjob scheduled to execute). Problem is, I have no idea what it means or why the error is suddenly occuring... Can anyone help?

 

The email reads:

 

PHP Warning:  Unknown(): Unable to load dynamic library '/usr/lib/php4/pgsql.so' - libpq.so.3: cannot open shared object file: No such file or directory in Unknown on line 0

 

Thanks in advance!

 

Nick

Link to comment
https://forums.phpfreaks.com/topic/48257-unable-to-load-library/
Share on other sites

Thanks for your reply.

 

This is the script Cron should be running but can't. It's part of Boonex's Dolphin social networking script:

 

<?

 

/***************************************************************************

*                            Dolphin Smart Community Builder

*                              -------------------

*    begin                : Mon Mar 23 2006

*    copyright            : © 2007 BoonEx Group

*    website              : http://www.boonex.com

* This file is part of Dolphin - Smart Community Builder

*

* Dolphin is free software; you can redistribute it and/or modify it under

* the terms of the GNU General Public License as published by the

* Free Software Foundation; either version 2 of the

* License, or  any later version.     

*

* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;

* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* See the GNU General Public License for more details.

* You should have received a copy of the GNU General Public License along with Dolphin,

* see license.txt file; if not, write to marketing@boonex.com

***************************************************************************/

 

require_once( '/home/httpd/vhosts/prdarlings.com/httpdocs/inc/header.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );

require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );

 

// - Functions -

function finish()

{

global $site;

    global $MODE;

 

if ( $MODE != "_LIVE_" )

{

$output = ob_get_contents();

ob_end_clean();

if ( $MODE == "_MAIL_" )

        {

mail( $site['email'], "{$site['title']}: Periodic Report (Notify Letters)", $output, "From: Periodic(Notify Letters) <$site>", "-f$site" );

        }

}

exit;

}

 

// -------------

 

// - Defaults -

$MODE = "_MAIL_";

$DAY = "_OBEY_";

 

// - Always finish

set_time_limit( 36000 );

ignore_user_abort();

 

 

// - Parameters check -

for ( $i = 0; strlen( $argv[$i] ); $i++ )

{

switch( $argv[$i] )

{

case "--live": $MODE = "_LIVE_"; break;

case "--mail": $MODE = "_MAIL_"; break;

}

}

 

if ( $MODE != "_LIVE_" )

ob_start();

 

$msgs_per_start = getParam( "msgs_per_start" );

 

$arr = db_arr( "SELECT COUNT(*) FROM NotifyQueue", 0 );

if ( $arr[0] <= 0 ) exit;

 

echo "\n- Start email send -\n";

echo "Total queued emails: $arr[0]\n";

$total_count = ($arr[0] < $msgs_per_start ? $arr[0] : $msgs_per_start);

$total_per_query = $total_count / 4 + 1;

echo "Ready for send: ". $total_count ."\n";

 

if ( $arr[0] > 0 )

{

$count_ok = 0;

$err = 0;

 

if ( $count_ok < $total_count )

{

// Notify Messages - HTML

$nfs_res = db_res("SELECT NotifyQueue.Email as ID1, NotifyQueue.Msg as ID2, NotifyEmails.Name as Name, NotifyEmails.Email, NotifyMsgs.Subj, NotifyMsgs.HTML as Body FROM  NotifyQueue INNER JOIN NotifyMsgs ON (NotifyMsgs.ID =  NotifyQueue.Msg) INNER JOIN NotifyEmails ON (NotifyEmails.ID = NotifyQueue.Email) WHERE  NotifyQueue.`From` = 'NotifyEmails' AND  NotifyEmails.EmailFlag = 'NotifyMe' AND NotifyEmails.EmailText = 'HTML' LIMIT $total_per_query",0);

while( $row = mysql_fetch_array( $nfs_res ) )

{

$headers = "From: {$site['title']} <{$site['email_notify']}>";

$headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=iso-8859-1\r\n" . $headers;

if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )

++$err;

    if ( $row[iD1] && $row[iD2] )

db_res("DELETE FROM NotifyQueue WHERE `Email` = $row[iD1] AND `Msg` = $row[iD2] AND `From` = 'NotifyEmails'", 0 );

else

echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[iD1], Msg ID: $row[iD2] )\n";

++$count_ok;

if ( $count_ok >= $total_count ) break;

}

}

 

 

if ( $count_ok < $total_count )

{

    // Notify Messages - TEXT

$nfs_res = db_res("SELECT NotifyQueue.Email as ID1, NotifyQueue.Msg as ID2, NotifyEmails.Name as Name, NotifyEmails.Email, NotifyMsgs.Subj, NotifyMsgs.Text as Body FROM  NotifyQueue INNER JOIN NotifyMsgs ON (NotifyMsgs.ID =  NotifyQueue.Msg) INNER JOIN NotifyEmails ON (NotifyEmails.ID = NotifyQueue.Email) WHERE  NotifyQueue.`From` = 'NotifyEmails' AND  NotifyEmails.EmailFlag = 'NotifyMe' AND NotifyEmails.EmailText <> 'HTML'",0);

    while( $row = mysql_fetch_array( $nfs_res ) )

{

if ( !mail( $row['Email'], $row['Subj'], $row['Body'], "From: {$site['title']} <{$site['email_notify']}>", "-f{$site['email_notify']}") )

++$err;

        if ( $row[iD1] && $row[iD2] )

        db_res("DELETE FROM NotifyQueue WHERE Email = $row[iD1] AND Msg = $row[iD2] AND `From` = 'NotifyEmails'", 0 );

else

echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[iD1], Msg ID: $row[iD2] )\n";

        ++$count_ok;

if ( $count_ok >= $total_count ) break;

}

}

 

if ( $count_ok < $total_count )

{

    // Profiles Messages - HTML

$nfs_res = db_res("SELECT NotifyQueue.Email as ID1, NotifyQueue.Msg as ID2, Profiles.RealName as Name, Profiles.Email, NotifyMsgs.Subj, NotifyMsgs.HTML as Body FROM  NotifyQueue INNER JOIN NotifyMsgs ON (NotifyMsgs.ID =  NotifyQueue.Msg) INNER JOIN Profiles ON (Profiles.ID = NotifyQueue.Email) WHERE  NotifyQueue.`From` = 'Profiles' AND Profiles.EmailNotify  = 'NotifyMe' AND Profiles.EmailFlag = 'HTML'",0);

    while( $row = mysql_fetch_array( $nfs_res ) )

{

$headers = "From: {$site['title']} <{$site['email_notify']}>";

$headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=iso-8859-1\r\n" . $headers;

if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )

            ++$err;

    if ( $row[iD1] && $row[iD2] )

db_res("DELETE FROM NotifyQueue WHERE Email = $row[iD1] AND Msg = $row[iD2] AND NotifyQueue.`From` = 'Profiles'", 0 );

        else

        echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[iD1], Msg ID: $row[iD2] )\n";

++$count_ok;

if ( $count_ok >= $total_count ) break;

    }

}

 

if ( $count_ok < $total_count )

{

    // Profiles Messages - TEXT

$nfs_res = db_res("SELECT NotifyQueue.Email as ID1, NotifyQueue.Msg as ID2, Profiles.RealName as Name, Profiles.Email, NotifyMsgs.Subj, NotifyMsgs.Text as Body FROM  NotifyQueue INNER JOIN NotifyMsgs ON (NotifyMsgs.ID =  NotifyQueue.Msg) INNER JOIN Profiles ON (Profiles.ID = NotifyQueue.Email) WHERE  NotifyQueue.`From` = 'Profiles' AND Profiles.EmailNotify  = 'NotifyMe' AND Profiles.EmailFlag <> 'HTML'",0);

    while( $row = mysql_fetch_array( $nfs_res ) )

{

if ( !mail( $row['Email'], $row['Subj'], $row['Body'], "From: {$site['title']} <{$site['email_notify']}>", "-f{$site['email_notify']}") )

            ++$err;

    if ( $row[iD1] && $row[iD2] )

    db_res("DELETE FROM NotifyQueue WHERE Email = $row[iD1] AND Msg = $row[iD2] AND NotifyQueue.`From` = 'Profiles'", 0 );

        else

        echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[iD1], Msg ID: $row[iD2] )\n";

        ++$count_ok;

if ( $count_ok >= $total_count ) break;

}

}

 

 

    if ( $count_ok < $total_count )

    {

        // Profiles Messages - TEXT or HTML

        $nfs_res = db_res("SELECT NotifyQueue.Email as ID1, NotifyQueue.Msg as ID2, NotifyQueue.MsgText as Body, NotifyQueue.MsgSubj as Subj, Profiles.RealName as Name, Profiles.Email FROM  NotifyQueue INNER JOIN Profiles ON (Profiles.ID = NotifyQueue.Email) WHERE  NotifyQueue.`From` = 'ProfilesMsgText' AND Profiles.EmailNotify  = 'NotifyMe'",0);

        while( $row = mysql_fetch_array( $nfs_res ) )

        {

            $email_flag = db_arr("SELECT EmailFlag FROM Profiles WHERE Email = '" . $row['Email'] . "' LIMIT 1");

            $body = $row['Body'];

            $headers = "From: {$site['title']} <{$site['email_notify']}>";

 

            if ( $email_flag['EmailFlag'] == "HTML" )

            {

            $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=iso-8859-1\r\n" . $headers;

            }

 

            if ( !mail( $row['Email'], $row['Subj'], $body, $headers, "-f{$site['email_notify']}") )

                ++$err;

            if ( !db_res("DELETE FROM NotifyQueue WHERE Email = $row[iD1] AND NotifyQueue.`From` = 'ProfilesMsgText'", 0 ) )

                echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[iD1], Msg ID: $row[iD2] )\n";

            ++$count_ok;

            if ( $count_ok >= $total_count ) break;

        }

    }

 

echo "Processed emails: $count_ok\n";

echo "Processed emails with errors: $err\n";

}

 

if ( $err ) finish();

 

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.