cron job help

Once you've installed phpList... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

cron job help

Postby ranksubmit » 1:31am, Mon 14 Apr, 2014

hello
I need help seting cron job phplist 3.5
I have try everything on the forum, none is working

my web is on share hosting with cpanel

example of cron jobs

/usr/local/cpanel/3rdparty/bin/php -q /home/tubealot/public_html/ticosviajando/lista/admin/index.php -pprocessqueue -c/home/tubealot/public_html/ticosviajando/config/config.php


/usr/local/bin/php -q /home/tubealot/public_html/www.ticosviajando.com/lista/admin/index.php -p processqueue -c /home/tubealot/public_html/www.ticosviajando.com/lista/config/config.php


please help
thank you
ranksubmit
phpList newbie
 
Posts: 3
Joined: 1:27am, Mon 14 Apr, 2014

Re: cron job help

Postby duncanc » 7:11am, Mon 14 Apr, 2014

In the first command, there seems to be a discrepancy between the path to phplist and the location of the config file
Code: Select all
ticosviajando/lista/admin/index.php

and
Code: Select all
ticosviajando/config/config.php

Should the latter be this?
Code: Select all
ticosviajando/lista/config/config.php

You can get more information by saving the output of the cron job. Appending this to the command will save the output to a file processqueue.log in the home directory
Code: Select all
 >~/processqueue.log 2>&1

If the output looks to be an html page then you are running the wrong php command. In that case try just php-cli instead of /usr/local/cpanel/3rdparty/bin/php
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: cron job help

Postby ranksubmit » 5:37pm, Mon 14 Apr, 2014

you are the boss, working now

gracias
regards from costa rica
ranksubmit
phpList newbie
 
Posts: 3
Joined: 1:27am, Mon 14 Apr, 2014

Re: cron job help

Postby varsang » 12:03am, Wed 16 Apr, 2014

I have tried various different options to get the cron job working but haven't had any luck so far.

I have 1and1 as my host.

The last cron job I tested with is

/usr/bin/php -q /kunden/homepages/9/d331326697/htdocs/lists/admin/index.php -p processqueue -c /kunden/homepages/9/d331326697/htdocs/lists/config/config.php

Need help from the experts here. Using phplist 3.0.5.

Thanks
varsang
phpLister
 
Posts: 12
Joined: 4:18am, Thu 25 Feb, 2010
Location: New Jersey, USA

Re: cron job help

Postby duncanc » 8:14am, Wed 16 Apr, 2014

If you save the output as I described in my earlier post then you should see what is happening.

Also remove the -q parameter from the command.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: cron job help

Postby varsang » 3:39pm, Wed 16 Apr, 2014

This is the output I get in the log file.

X-Powered-By: PHP/4.4.9
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html
varsang
phpLister
 
Posts: 12
Joined: 4:18am, Thu 25 Feb, 2010
Location: New Jersey, USA

Re: cron job help

Postby Aly22 » 5:43am, Thu 17 Apr, 2014

I'm late to the party, but just upgraded and experienced the same issue. I've got a dedicated server on cPanel. Here is what I had been using successfully for a long while:

Code: Select all
/usr/local/bin/php /home/MYSITE/public_html/lists/admin/index.php -pprocessqueue -c /home/MYSITE/public_html/lists/config/config.php /dev/null


That no longer worked. SO I tried every variation in these forums with no luck. Until I went back to the first post in this thread and copied what ranksubmit had (because it was a cPanel issue) and noted the corrections that duncanc made.

Code: Select all
/usr/local/bin/php -q /home/MYSITE/public_html/lists/admin/index.php -pprocessqueue -c /home/MYSITE/public_html/lists/config/config.php


And that worked! So here is what worked for me --
adding -q
and removing /dev/null

THANK YOU and hope this is helpful to someone else :)
Aly22
phpLister
 
Posts: 6
Joined: 8:27pm, Sat 16 May, 2009

Re: cron job help

Postby duncanc » 7:25am, Thu 17 Apr, 2014

varsang wrote:This is the output I get in the log file.

X-Powered-By: PHP/4.4.9
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html

That shows the command /usr/bin/php is running php-cgi not php-cli.
You need to ask the hosting company for the correct command to run pho-cli, or change the cron job to use php-cgi as described in this topic http://forums.phplist.com/viewtopic.php?f=34&t=39385#p96465.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: cron job help

Postby Dragonrider » 8:34am, Thu 17 Apr, 2014

Just a note to point out that according to the System Requirements for phpList 3.0.x seems to require PHP5.3 as a minimum.

I note on your log that you seem to be using PHP4.4 which is probably too old for various items within phpList, and whilst I'm not saying that this is your issue, 1&1 do offer you the ability to upgrade to PHP5.2 which may be enough and 1&1 seem to be saying that PHP5.4 is actually PHP6?

My own host offers me PHP 5.2, 5.3, 5.4 and 5.5 currently and I'm running their 5.4 and phpList 3 works perfectly with that setting.
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

Re: cron job help

Postby varsang » 4:44pm, Thu 17 Apr, 2014

Thanks for your feedback. I am now running php 5.4.

I tried creating a file with the following code

Code: Select all
<?php
  include('http://domain/lists/admin/?page=processqueue&login=admin&password=password');
?>


And having this for the cron

Code: Select all
* * * * * /usr/local/bin/php /kunden/homepages/9/d331326697/htdocs/phplist_cron.php >~/processqueue4.log 2>&1


In the output log file I see html. Something is happening but I'm guessing there is a code problem.

Help! Thanks again.
varsang
phpLister
 
Posts: 12
Joined: 4:18am, Thu 25 Feb, 2010
Location: New Jersey, USA

Re: cron job help

Postby duncanc » 5:10pm, Thu 17 Apr, 2014

Why have you created a php file with an include statement?

I pointed at a post that gives the command to run php cgi. Have you tried that and if so what problems did you have?
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: cron job help

Postby varsang » 1:15pm, Sat 19 Apr, 2014

I did as per the post...

* * * * * php /kunden/homepages/9/d331326697/htdocs/lists/admin/index.php page=pageaction action=processqueue  login=xxxxx password=xxxxx>~/processqueue3.log 2>&1

I get the same output.

X-Powered-By: PHP/4.4.9
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html

Attached is the php info. If that helps.

Thanks again.
Attachments
Screen Shot 2014-04-19 at 9.15.44 AM.png
Screen Shot 2014-04-19 at 9.15.44 AM.png (205.22 KiB) Viewed 6644 times
varsang
phpLister
 
Posts: 12
Joined: 4:18am, Thu 25 Feb, 2010
Location: New Jersey, USA

Re: cron job help

Postby duncanc » 2:12pm, Sat 19 Apr, 2014

The command that you are using, php, is running php 4.4.9. You need to find out from your hosting company the correct command to run php 5 in a cron job.

If your web server is using php 5.4 then your other approach of using an include file might work but you need to change the URL to be similar to the cron job command, using the page and action parameters.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: cron job help

Postby varsang » 2:23pm, Sat 19 Apr, 2014

I found how I can run php5 with the service provider.

Now I got this output.

X-Powered-By: PHP/5.2.17
Set-Cookie: PHPSESSID=fdf50366a5d3cc6247fd390743d42ac1; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-UA-Compatible: IE=Edge
X-Robots-Tag: noindex
Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />...

Cont. with the rest of the HTML.
varsang
phpLister
 
Posts: 12
Joined: 4:18am, Thu 25 Feb, 2010
Location: New Jersey, USA

Re: cron job help

Postby duncanc » 2:35pm, Sat 19 Apr, 2014

That is the expected output from phplist.

From the event log can you see whether phplist ran and processed any messages?
Otherwise you will need to examine the output to see whether phplist reported an error. It is probably simplest to save the output as a file and view in a browser.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Next

Return to Questions and Problems after Installing

Who is online

Users browsing this forum: No registered users and 3 guests