web hosting line
1.866.605.2484

Web hosting

Go Back   Web Hosting Forum - Web hosting discussion at SiteGround.com > Popular Software > Other Software and Applications

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2006, 01:04 PM
jrosenburg jrosenburg is offline
Junior Member
 
Join Date: Apr 2006
Posts: 4
Default Need help w/ PHPList Cron Job

I am new to understanding how to configure the command line for a cron job. I have PHPList setup and running on my site, but I am unable to find the correct command line for Cron to automaticly process the queue. Can anyone help me?
Reply With Quote
  #2  
Old 04-21-2006, 09:11 AM
Tom's Avatar
Tom Tom is offline
SiteGround Team Member
 
Join Date: Jun 2005
Posts: 178
Default

You can check the following topic:

http://www.phplist.com/forums/viewto...er=asc&start=0

It is quite related to your question. Here is the most important part:

Quote:
First of all, (like most mortals) you have to install PHPlist.
On our case,we go through Fantastico and install it.
Now we have to create a file called "phplist" (without the quotes please) in the same directory as the phplist installation.
The file should contain the follwing code

#!/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

# 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/water/public_html/fountain/config/config.php
export CONFIG

# 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/bin/php /home/water/public_html/fountain/admin/index.php $*


Copy and paste it as it is, but remember to replace the domain, directory, user, password, etc. Double check there are no spaces or enter after the last character.


One this is completed, now we have to edit a file named "config.php" which is located in /public_html/fountain/config/
Check that the following line looks like this :
define ("MANUALLY_PROCESS_QUEUE",1);
And this line:
define("MAILQUEUE_BATCH_SIZE",0);
Now look for the following lines
# define the length of one batch processing period, in seconds (3600 is an hour)
define("MAILQUEUE_BATCH_PERIOD",60);

and add the following line after it:
# Throttle sending messages; indicates the number of milliseconds to pause
# between each message (millisecond is one-millionth of a second)
define("MAILQUEUE_PROCESSING_THROTTLE",2000000);

This means is going to send an e-mail every 2 secconds.

Now look for the file "processqueue.php" in the directory /public_html/fountain/admin/
Find the following line:
output("Sending $messageid to $useremail");
sendEmail($messageid,$useremail,$userhash,$htmlpre f,$rssitems);

and add the following just after it
usleep(MAILQUEUE_PROCESSING_THROTTLE);

Save the file.

We are almost done. Just hang on a little.
Now lets go to cron jobs.
You just have to sent this up once, the day and hour you want the queue to start to be processed.
The command should look like this
php /home/water/public_html/fountain/admin/index.php page=processqueue login=fish password=seashell

Now relax, prepare you message, queue it, and just watch it work.
By the way don't hit the process queue that you have on the phplist homepage, just forget about that link.

By the way, just let me know if it worked.
Reply With Quote
  #3  
Old 08-05-2006, 02:01 PM
vpndude vpndude is offline
Junior Member
 
Join Date: Aug 2006
Location: Columbia, MD USA
Posts: 5
Talking This one worked for me on siteground

curl 'http://www.smartchive.com/lists/admin/index.php?page=processqueue&login=loginname&passwo rd=password' > /dev/null and I set the job to run every 10 minutes.

I set the process queue to run 60 messages every 10 minutes, keeping under that magic 400 number. I've tried a lot, this one seemed to be the best one for me.
__________________
Paul Misner
www.smartchive.com
vpndude@vpndude.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:29 PM.

Copyright © SiteGround.com Inc