Page 1 of 1

How to run PHPList in the Command Line [solved]

PostPosted: 11:20pm, Tue 22 Sep, 2009
by vestaxpdx

Firstly I know this has been asked a million times and endless topics seem to be present, so sorry for posting again but i have searched and searched and found nothing helpful.

I simply want to run the process queue method in the command line, as a have a fair amount of user 10,000 + and I assume the web page will time out if I run it from the browser (even though it says safe to stop browser, is it really though?)

Ok I have set up the phplist script from the example. (via the docs)

But all I get when I run " ./phplist -pprocessqueue " is a crap load of HTML that gets spit out.

Looking at the HTML I can see its producing the login page.

Ok, fine, on further searching I have found people passing the username and paasword variable. (even though it says nothing about this in the docs???)

So I try " ./phplist -pprocessqueue login=MYUSER password=MYPASSWORD "

This time it doesn't spit out a login page, but the main page (phplist :: PHPlist :: Main Admin Page) instead and not the processing queue page :(

I have also played with the $commandline_users = array();

I have tried it blank, and with my Cpanel username. Both without any joy, although I dont really see how this would suddenly stop it from spiting out HTML.

So back to the point really, why the hell is it spitting out loads of HTML ? Why doesn't it just output some friendly messages that I would expect stating what's going on with the processing.

Why is it outputting HTML?

Have I done something completely wrong? Is it supposed to output HTML, surely not?

Forgive me if im being very thick but I cant find any decent explanation as to how to simply run the process queue method in the command line, I dont even want to do it in a cron job yet! lol

Someone please enlighten me in some way, this is all very frustrating.

I am using the latest version 2.10.10

Hope someone can help,



Re: How to run PHPList in the Command Line

PostPosted: 10:26am, Wed 23 Sep, 2009
by vestaxpdx

I hope this helps people who may be doing a search as i managed to make it work.

I set the $commandline_users = array(); with no user name.

Then it seems the phplist script doesn't really work, whether its differing php version or system installs i dont know. I am on CentOS if it helps.

So in order to process the queue you just need to simply run this command in your terminal

# php /home/USER/public_html/lists/admin/index.php -pprocessqueue

And it works! messages are processed and sent.

Why there is not better description in the docs i dont know.

Hope this helps :)

Re: How to run PHPList in the Command Line [solved]

PostPosted: 11:32am, Tue 08 Dec, 2009
by jc786
do i need to set the day and time settings in the cron jobs page. How will this affect the throttle settings in phplist?

My host has a llimit of 750 outbound emails an hour and i want to send out 10,000 emails. so if i set the thottle to 750/hour i will need to keep phplist running for 14 hours.

Do i just set the cron job to run one time and leave it to phplist and its throttle setting or do i have to set the cron job to run every hour for 14 hours?


Re: How to run PHPList in the Command Line [solved]

PostPosted: 12:01pm, Tue 08 Dec, 2009
by vestaxpdx
If you set up batches then you will need to re run the command several times till it completes.

But you dont need to if you just use the MAILQUEUE_THROTTLE setting.

If you can only send 750 an hour set the MAILQUEUE_THROTTLE to 6

This will send one message every 6 seconds. So in 1 hour (3600 sec) you will send 600. This will leave 150 an hour for other normal emails your users might use personally.

Just run the command once and phphList will just sit there processing them until they are all done (which will take a while).

I dont tend to have a cron job as I like to invoke the command manually so I can choose exactly when to send mails out.

Hope this helps,

Re: How to run PHPList in the Command Line [solved]

PostPosted: 10:45am, Fri 11 Dec, 2009
by jc786
Thank you for your reply. That was what i was thinking, but just to be 100% sure when you say just set the "command once" i assume you mean set the command in the cron jobs page right? Because i dont want to keep phplists open in the internet browser for all that time - that would defeat the object.

Re: How to run PHPList in the Command Line [solved]

PostPosted: 12:34pm, Fri 11 Dec, 2009
by vestaxpdx
Yes sorry you can set it to run the cron job say once a day.

The below cron tab will run it once a day at 4am

0 4 * * * php /home/USER/public_html/PHPLIST_FOLDER/lists/admin/index.php -pprocessqueue

Please check the path is correct, USER is your account user name for your site and PHPLIST_FOLDER as any folder you might of placed phplist into.

If you can gain SSH access to the command line, this is where I invoke it manually without a cron and not in the browser environment.


Re: How to run PHPList in the Command Line [solved]

PostPosted: 3:32pm, Fri 11 Dec, 2009
by jc786
thank you for your timely responses. I really appreciate it.