2.10.10: commandline cron not working after upgrade [solved]

Discuss, research, share, find, and solve bugs

2.10.10: commandline cron not working after upgrade [solved]

Postby jfm5440 » 12:55pm, Fri 08 May, 2009

My command line processqueue cron jobs worked fine under 2.10.4 but after upgrade to 2.10.10 they stopped.

It looks like the parameters are not getting passed. I have the "$commandline_users = array();" set so no user id is needed.

Here is what I get from my old install:

[john]$ /usr/local/apache/php/bin/php -q /home/john/html/xxx/docsold/admin/index.php -p processqueue
PHPlist version 2.10.4 (c) 2000-2009 Tincan Ltd, http://www.phplist.com
Started
Sending in batches of 300 emails
Script stage: 6
Finished, Nothing to do
Finished, All done

Here is new:

[john]$ /usr/local/apache/php/bin/php -q /home/john/html/xxx/docs/admin/index.php -p processqueue
PHPlist version 2.10.10 (c) 2000-2009 Tincan Ltd, http://www.phplist.com
Usage: /home/john/html/lists.bmdc.org/docs/admin/index.php -p page [other parameters]




I can work around this by pointing the cron to my old install but would like to fix this.


here is script:

#!/bin/bash

# script to run PHPlist from commandline. You may need to edit this to make it work
# with your shell environment. The following should work for Bash on Fedora Linux
# but this may vary strongly in other situations. You will need to dig into the
# code to make sure it works for you.

# in commandline mode, access is restricted to users who are listed in the config file
# check README.commandline for more info

# identify the config file for your installation
CONFIG=/home/john/html/lists.bmdc.org/docs/config/config.php
export CONFIG

USER=admin
export USER

# alternatively you can use -c <path to config file> on the commandline

# run the PHPlist index file with all parameters passed to this script
/usr/local/apache/php/bin/php -q /home/john/html/lists.bmdc.org/docs/admin/index.php $*

--
JM
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after upgrade

Postby jfm5440 » 2:43pm, Fri 08 May, 2009

Well it appears to be a PHP register_globals problem.

If i stub out

require_once dirname(__FILE__) .'/commonlib/lib/unregister_globals.php';

from index.php the cli works.

I know there are security implications in leaving register_globals on (which is my php.ini default because I want to for some old scripts).

but index.php should work without global registration right?

anyway if I edit .htaccess and add

php_flag register_globals off

the cli continues to work fine.
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby chap0230 » 4:17pm, Wed 13 May, 2009

I'm experiencing this same error with 2.10.10
commenting out
require_once dirname(__FILE__) .'/commonlib/lib/unregister_globals.php';
fixes this for me as well but I would rather not have to do this
chap0230
phpList newbie
 
Posts: 1
Joined: 4:15pm, Wed 13 May, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby alForm » 1:31pm, Mon 25 May, 2009

Thanks a lot for sorting this out.
alForm
phpLister
 
Posts: 5
Joined: 3:41pm, Thu 21 May, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 9:35pm, Wed 10 Jun, 2009

Hi! I'm new here, form Uruguay, South America (sorry for my english)

I've installed phplist for the fisrt time a week or so ago. I think i got everything going on, except for the cron job to porccess queue. When manually sent, messages get to members of the list without any problem. But I have 15.000 members, an my serve only admits 500 mails per hour...

this is what I got in my cron job:
php -f /home/xxx/xxx/xxx/html/lists/admin/index.php page=processqueue login=xxx password=xxx

I got this message:
PHPlist version 2.10.10 (c) 2000-2009 Tincan Ltd, http://www.phplist.com
Usage: /home/xxx/xxx/xxx/html/lists/admin/index.php -p page [other parameters]

Other data:
Im at a grid server at Media Temple.
They use cgi and not cli.
The -f /home/xxx path was provided to my by MT support
I also got this:

$commandline_users = array();
define ("MANUALLY_PROCESS_QUEUE",1);

My knowledge about php, etc, is almost zero....

So, if anyone could help me to configure this cron job I will be really grateful!!! :roll:
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby jfm5440 » 9:45pm, Wed 10 Jun, 2009

Well if you can get access to index.php under the /admin directory and remove this line:

require_once dirname(__FILE__) .'/commonlib/lib/unregister_globals.php';

it should work
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 9:56pm, Wed 10 Jun, 2009

Hi!

I've just did it

I erease that line in the index.php that's inside admin of phplist

in some minutes I will tell you if it is working! Hope so!

I got a message in the queue, waiting to be send by the cron
and the cron is set to "start " each 5 minutes ..
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 10:04pm, Wed 10 Jun, 2009

No :(

It didn't work

I still getting this:

PHPlist version 2.10.10 (c) 2000-2009 Tincan Ltd, http://www.phplist.com
Usage: /home/xxx/xxx/xxx/html/lists/admin/index.php -p page [other parameters]

:cry:

another idea?
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby jfm5440 » 10:57pm, Wed 10 Jun, 2009

I wonder if config.php is getting read in.

is your cron firing a shell script as per the recommendations?

for example this is my cron:

*/10 * * * * /home/john/scripts/phplist.sh -pprocessqueue >/dev/null 2>&1


phplist.sh is a shell script:


#!/bin/bash

# script to run PHPlist from commandline. You may need to edit this to make it work
# with your shell environment. The following should work for Bash on Fedora Linux
# but this may vary strongly in other situations. You will need to dig into the
# code to make sure it works for you.

# in commandline mode, access is restricted to users who are listed in the config file
# check README.commandline for more info

# identify the config file for your installation
CONFIG=/home/john/html/lists.bmdc.org/docs/config/config.php
export CONFIG

#USER=admin
#export USER

# alternatively you can use -c <path to config file> on the commandline

# run the PHPlist index file with all parameters passed to this script
/usr/local/apache/php/bin/php -q /home/john/html/lists.bmdc.org/docs/admin/index.php $*
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 11:12pm, Wed 10 Jun, 2009

"is your cron firing a shell script as per the recommendations?"

I don't know what that means!

In my control panel Ther is an option to add a cron job. There you can you got a field to put the

"Command or script to execute:"

I got: php -f /home/xxx/xxx/xxx/lists/admin/index.php page=processqueue login=xxx password=xxx

the user is one admin I created inside phplist, in wich I marked "all" in the atributes, the line corresponding to precessqueue, as I read in some post here

then you got the Scheduling Settings

I don´t know what "a shell script" is!!!

Do I have to create a file with an ".sh" extention an put inside what you show?
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby jfm5440 » 11:33pm, Wed 10 Jun, 2009

Unless you have a way to log in to your server where you get a command prompt where you can do things like type ls to get a directory listing then you are totally under the control of a admin GUI.
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 11:41pm, Wed 10 Jun, 2009

Well, I've created a .sh file, copied inside what you posted and put int the cron job this:

/home/xxx/xxx/xxx/html/lists/phplist_cron.sh

this is what i get

/home/xxx/xxxx/xxxx/html/lists/phplist_cron.sh: line 21: /usr/local/apache/php/bin/php: No such file or directory

i imagine i have to adapt that line to my server, but I wonder what i have to put there!
Last edited by Flavio on 2:00pm, Thu 11 Jun, 2009, edited 1 time in total.
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby jfm5440 » 11:50pm, Wed 10 Jun, 2009

that's because that happens to be where my server's php executable resides. Probably different on yours

you might be able to find yours this way:

which php

that will only work if ph is in your search path. I will bet it is but if not run this:

find / -name php -print

now go have a cup of coffee.
jfm5440
phpLister
 
Posts: 13
Joined: 4:45pm, Sun 18 Mar, 2007

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby Flavio » 2:31pm, Thu 11 Jun, 2009

Hi!

Im still on it :(

This is what I ve in my cron job:

/home/xxx/xxx/xxx/html/lists/phplist_cron.sh

in the phplist_cron.sh I have: (with 755 permission)

#!/bin/bash

# script to run PHPlist from commandline. You may need to edit this to make it work
# with your shell environment. The following should work for Bash on Fedora Linux
# but this may vary strongly in other situations. You will need to dig into the
# code to make sure it works for you.

# in commandline mode, access is restricted to users who are listed in the config file
# check README.commandline for more info

# identify the config file for your installation
CONFIG=/home/xxx/xxx/xxx/html/lists/config/config.php
export CONFIG

#USER=admin
#export USER

# alternatively you can use -c <path to config file> on the commandline

# run the PHPlist index file with all parameters passed to this script
/home/xxx/xxx/xxx/html/lists/admin/index.php $*

What I get in a message from the cron is:

/home/xxx/xxx/xxx/html/lists/admin/index.php: line 1: ?php: No such file or directory
/home/xxx/xxx/xxx/html/lists/admin/index.php: line 4: syntax error near unexpected token `$er'
/home/xxx/xxx/xxx/html/lists/admin/index.php: line 4: `$er = error_reporting(0);'
Flavio
phpLister
 
Posts: 6
Joined: 9:16pm, Wed 10 Jun, 2009

Re: commandline cron not working after 2.10.10 upgrade [solved]

Postby evaluacion » 8:47pm, Thu 09 Jul, 2009

Flavio,

I've just sent you a private message, I'm also from Uruguay and don't get anything about programming stuff (I work on communications), I'm on one of the lists to understand why in the new version I can only list the 1st 50 users of a list (1-50) and don't get the responses bc of all the technical stuff.

Tks!
Jen
evaluacion
phpList newbie
 
Posts: 2
Joined: 4:56pm, Tue 09 Jun, 2009


Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron