Sitebase does not currently provide support for this item.

29 comments found.

Nice script as ever, saved me days of coding. Can you help with this error

“Fatal: Call to a member function Log() on a non-object”

when I write

if ($login_result1==1) { $LogBase->Log(‘Could not connect to FTP 1 ’); }

any ideas?

You get that errror because you didn’t create an instance of the LogBase class. Make sure you add the lines from the documentation where I configure the LogBase:

$LogBase = new LogBase();

Thanks for your reply SiteBase, I have not given you enough detail as the error log and the screen error function is working OK and I have the$LogBase = new LogBase(); included.

the beginning of the scirip has the following:

include(“imageprocessor.php”); include(“LogBase.php”); // // Set up error log options // $LogBase = new LogBase(); // create a new instance of log // Types to log $LogBase->enable_error(true, E_PARSE, E_WARNING, E_ERROR); $LogBase->enable_fatal(); $LogBase->enable_exception(); // Log methods $LogBase->enable_method_file(true, array(‘path’ => dirname( FILE ).’/error_log/’)); $LogBase->enable_method_print(); // $LogBase->enable_method_mail(true, array(‘email’ => ‘’)); // // Global scope VARS // .. ..

Then it lists the various subrountine functions including

function ftp_send_image1($chn1) { .. pre amble .. $conn_id1 = ftp_connect(FTP_SERVER1); $login_result1 = ftp_login($conn_id1, $ftp_user_name1, $ftp_user_pass1);

if ($login_result1<>1) // could not connect or login to ftp { $LogBase->Log(‘Could not connect to FTP 1 ’); // log the problem ftp_close($conn_id1); // close the FTP stream return $login_result1; } $upload1 = ftp_put($conn_id1, $destination_file1, $imagefile_name1, FTP _BINARY); .. .. etc

and then the main calling script.

$error32=ftp_send_image1(‘1’); .. etc

When I run this I get the

“Fatal: Call to a member function Log() on a non-object”

Can you help please?

Cheers K

The method must be in lowercase so:


Hi again, I tried the following that included the change you suggested as follows;

if (!$login_result1) // could not connect or login to ftp


$LogBase->log(‘Could not connect to FTP 1 ’) ; // log the problem

ftp_close($conn_id1); // close the FTP stream

return $login_result1;


and it gave the error

Logger result:

Fatal: Call to a member function log() on a non-object (/var/www/imageprocessing/push_ftp.php:83)

Hope you can help, everything else works fine, it would just be nice to ba able to log errors with the log() command.



Can you email me that push_ftp.php file? You can find my email address on my website.

Hi $handler->SetServer(“”); $handler->SetServerPsk(“the same string as $logserver_psk”);

How do I use that function? When I used that function SetServer so cache folder do not create file **.log Looks like server.php do not run Could you fix it for me ?? Thank you

The log to server function is not supported anymore in the latest release of the PHP error logger.

Can you please add the server logger back in. Was a really great feature. (not sure why you removed it anyways.).


I’ll see what I can do.

Can I send logged error to an email? Say I wish to receive an email whenever fatal error or database server connection goes down. Does your script work this way too?

As metioned in the description: yes this is possible:

$LogBase->enable_method_mail(true, array('email' => ''));

also would like server logger in next update

I’d like to use the email reporting facility with this script. Does it have the following features?

  • Email errors on cron job (so, do not send an email each time an error is triggered).
  • Configure which types of errors are sent in email report (for example, ignore PHP STRICT errors).

I’m basically looking for configuration options for the email.

I’d be happy to code this functionality myself, is the code readily extended (e.g. did you use object oriented practices?).

Thank you.

These features are not included but there is a basic mail method included and the script is OO so it is pretty simple to extended it to fit your needs.

This Author is no longer around.