Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 05:13:44 PM

Pages: [1]   Go Down
  Print  
Author Topic: phplist cron job to process queue  (Read 6004 times)
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« on: January 02, 2007, 08:48:45 AM »

Anyone use a cron job to process the queue for sending email using phplist? If so, would you post the cron job?

I'm thinking about allowing others to send email using the program so I'd like to automate the queue processing.

Thanks,
John
Logged
Danielle
Guest
« Reply #1 on: January 02, 2007, 01:22:42 PM »

Hi lexhair,

I wanted to point out that we have an hourly limit if 800 emails sent per hour and you really need to ensure you do not go over the limit (20 emails per minute is the max per minute).  When you exceed the 800, the emails begin bouncing for that hour, the server load goes up, the server processes go up and we then shut email off on the account and call the person and email the person about it.  As such, it is best to not go over so you do not try to crash the server and end up with the email disabled by us temporarily until you fix the issue.

You can set the email to stagger per hour by these settings in the FAQ on PHPList:

http://desk.lunarpages.com/faq.php?do=article&articleid=265

The issue with letting other users send is that if you have it staggered for 1 list, it won't do that but use 800 for each user who tries to process, ensuring your account does go over the 800 per hour if you have a lot of members.  If you have only a few members, it shouldn't become an issue, though, but I felt it a good idea to provide these details to avoid anything adverse from occurring.

Have a Happy Week
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #2 on: January 02, 2007, 01:30:43 PM »

Hi Danielle!!
There's no way I'll be close to that limit. We're talking 100 emails at a shot max and throttle them using phpmail.

My other users will be using a subset criteria on the list so we're talking about a dozen or so emails so the limit's not a problem there.

I wanted to use the cron job because the mechanics of sending a message using phpmail is significantly different from using an email client. I know about processing the queue manually but I can just see the blank looks when I explain they have to click on the process queue link to actually send the message.

John
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #3 on: January 19, 2007, 06:37:38 AM »

If anyone still cares, I figured it out with some help.

Step 1: Login to phplist and create an admin with permissions to load the processqueue and processbounces ONLY for ALL. This is an optional step but improves security in my opinion. If your php script is somehow exploited all the intruder gets is a login for a user that can only send email and process bounces. Quite harmless.

Step 2: Visit this page. Create and upload the executable php script [whatever.php] with permissions as noted. The user name and password in the php script should be the same as the admin you created in Step 1.

Step 3: Create the cron job via CPanel or however you like to create cron jobs. My cron job looks like this:
Code:
php -q /home/[lunarpages user name]/public_html/[your folder name]/[whatever.php] > /dev/null 2>&1
The PHPList manager outputs reports when the queue gets process so you don't need the cron reporting as well hence the dev/null.
Logged
weaintsayin
Trekkie
**
Offline Offline

Posts: 19


« Reply #4 on: September 10, 2007, 01:53:00 AM »

THIS SOLUTION REALLY WORKS. I spent three days back and forth between here and the phplist site trying to get CRON jobs working for PHPList on Lunarpages.

The following php file, placed in a subfolder (elist) of my list directory did the trick for me (obviously you will change the hostname, login and password:


In a file called processqueue.php
#!/usr/local/bin/php
<?php
  include('http://myhostname.com/elist/admin/index.php?page=processqueue&login=somelogin&password=apassword');
?>

This is called from the CRON with the following line:
php -q /home/mylunarpageslogin/public_html/elist/cronphp/processqueue.php >/dev/null

I have set up the "somelogin" on phpList to be able to only process the queue and in my case getrss (which is what I need).

I hope this helps out by re-affirming that this can be done and is not hard to set up. I also found that the fantastico installation left a line in CRON that did not work. When setting this up, leave off the > /dev/null and monitor the email address that you set on the lunarpages cron screen. This will tell you if you've made a typo and some file is not found or some other silly mistake.

Good luck!
Logged
Papi
Spacescooter Operator
*****
Offline Offline

Posts: 43


WWW
« Reply #5 on: September 26, 2007, 10:39:57 AM »

So i've got the above set up, but I am a little confused as to whether or not I need to set up a campaign in queued, and if I have more than one campaign, how can I stagger them so that the cron job doesn't fire them all off?
Logged
tegralens
Spacescooter Operator
*****
Offline Offline

Posts: 39


« Reply #6 on: October 03, 2007, 07:36:12 AM »

THIS SOLUTION REALLY WORKS. I spent three days back and forth between here and the phplist site trying to get CRON jobs working for PHPList on Lunarpages.

The following php file, placed in a subfolder (elist) of my list directory did the trick for me (obviously you will change the hostname, login and password:


In a file called processqueue.php
#!/usr/local/bin/php
<?php
  include('http://myhostname.com/elist/admin/index.php?page=processqueue&login=somelogin&password=apassword');
?>

This is called from the CRON with the following line:
php -q /home/mylunarpageslogin/public_html/elist/cronphp/processqueue.php >/dev/null

I have set up the "somelogin" on phpList to be able to only process the queue and in my case getrss (which is what I need).

I hope this helps out by re-affirming that this can be done and is not hard to set up. I also found that the fantastico installation left a line in CRON that did not work. When setting this up, leave off the > /dev/null and monitor the email address that you set on the lunarpages cron screen. This will tell you if you've made a typo and some file is not found or some other silly mistake.

Good luck!
How do I setup the time on the cron job?  I don't know if to setup everyday or what.
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #7 on: October 29, 2007, 08:50:48 AM »

So i've got the above set up, but I am a little confused as to whether or not I need to set up a campaign in queued, and if I have more than one campaign, how can I stagger them so that the cron job doesn't fire them all off?
Use the embargo feature of phplist to schedule each email.
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #8 on: October 29, 2007, 08:52:34 AM »

THIS SOLUTION REALLY WORKS. I spent three days back and forth between here and the phplist site trying to get CRON jobs working for PHPList on Lunarpages.

The following php file, placed in a subfolder (elist) of my list directory did the trick for me (obviously you will change the hostname, login and password:


In a file called processqueue.php
#!/usr/local/bin/php
<?php
  include('http://myhostname.com/elist/admin/index.php?page=processqueue&login=somelogin&password=apassword');
?>

This is called from the CRON with the following line:
php -q /home/mylunarpageslogin/public_html/elist/cronphp/processqueue.php >/dev/null

I have set up the "somelogin" on phpList to be able to only process the queue and in my case getrss (which is what I need).

I hope this helps out by re-affirming that this can be done and is not hard to set up. I also found that the fantastico installation left a line in CRON that did not work. When setting this up, leave off the > /dev/null and monitor the email address that you set on the lunarpages cron screen. This will tell you if you've made a typo and some file is not found or some other silly mistake.

Good luck!
How do I setup the time on the cron job?  I don't know if to setup everyday or what.
I set my cron up to run every hour FWIW.
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #9 on: November 02, 2007, 07:42:11 PM »

This doesn't work for me anymore since Segonax was upgraded. I get a 500 error.
Logged
katrina1
Guest
« Reply #10 on: November 03, 2007, 04:24:56 AM »

Check the permissions on your folders and files. Folders are usually 755 and files are 644. If you see 777 or 666 you will get that error.
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 402


« Reply #11 on: November 07, 2007, 07:52:30 AM »

Check the permissions on your folders and files. Folders are usually 755 and files are 644. If you see 777 or 666 you will get that error.
Thanks for replying. This wasn't the problem. All permissions were ok.

It wasn't the cron job that was breaking. It was my entire PHPList install. Something associated with the upgrade (at least it started spitting errors when Segonax upgraded), broke the .htaccess file.

I went to the installation FAQ at phplist.com. Came up with this ditty:
Quote
If you get a '500 Server Error' when installing, your server probably runs php as a cgi, not as an apache module (also known as phpsuexec). You need to edit the file '/lists/.htaccess' delete or comment out (with a #) the line about 'php_flag magic_quotes_gpc'. e.g.

# php_flag magic_quotes_gpc on
I edited my existing .htaccess file and my install (as well as the ability to run the cron) came back. Hope this helps someone out.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: