using phpmailer with cron job

using phpmailer with cron job

Posted by: msherwoo
Posted on: 2009-08-02 12:48:00


I am using PHPMailer_v5.0.2 with php/5 and mysql/5.

When I run my cron job and it it encounters the line

require_once('PHPMailer_v5.0.2/class.phpmailer.php');
(note: full path is actually used, and the file is found).

I get the error message:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/.mish/.../PHPMailer_v5.0.2/class.phpmailer.php on line 53

.. which is the first line of code in that file

I have other cron jobs that run using the same path to php ( it is /usr/local/bin/php), so I know it is ok.

If i run my cron job manually from the browser it runs fine.

But what must happen for phpmailer to be able to run with a cron job?

Thanks,

Mike



Re: using phpmailer with cron job

Posted by: Atropos7
Posted on: 2009-08-02 13:24:00

In reply to:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/.mish/.../PHPMailer_v5.0.2/class.phpmailer.php on line 53

.. which is the first line of code in that file

I have other cron jobs that run using the same path to php ( it is /usr/local/bin/php), so I know it is ok.


PHP 4.4.9 cli= /usr/local/bin/php
PHP 5.2.6 cli = /usr/local/php5/bin/php

Parse error, unexpected tokens (eg T_STRING) means that PHP couldn't understand the source code. Uh, either the PHP source has a mistake (unlikely unless you modified it) or you are using a version of PHP that doesn't support new syntax features.




Customer since 2000 cool openvein.org

Re: using phpmailer with cron job

Posted by: msherwoo
Posted on: 2009-08-02 13:56:00

You are a dream.

Thanks,

Mike

Tags: phpmailercron jobserror syntax errorphp 5error messagecron job