[how to] make phplist work with Cron Jobs

Solutions for other advanced phplisters

Solution worked?

Yes
17
30%
No
14
25%
Still working on it
26
46%
 
Total votes : 57

Error Message

Postby linsys » 9:23pm, Mon 20 Jun, 2005

I'm now getting this message:
PHPlist version 2.8.12 (c) 2000-2005 Tincan Ltd, http://www.phplist.com
Usage: /export/www/customers/email.americanitsolutions.us/htdocs/lists/admin/index.php -p page [other parameters]
linsys
phpLister
 
Posts: 6
Joined: 5:13pm, Thu 19 May, 2005

Re: Throttle in 2.8.12 ?

Postby Cafamily » 9:08pm, Thu 07 Jul, 2005

drachomium wrote:I am trying to get the Throttle function working in my PhpList version 2.8.12, according this topic started by Daniela.

Has anyone else tried Throttle with this Version?

I'm trying the setup by Cafamily, who seemed to have his/her wits about them concerning the superfluidity of the "phplist" file unless actually being used. :roll:
Code: Select all
/usr/local/scripts/phplist -p processqueue

Question then, is there a lack of security with this type of process? I have .htaccess and no require_login. Does CaFamily's commandline_users trick avail anything then?


Sorry hadn't been checking here for a while.
The answer to your question about security is that as long as /usr/local/scripts (or wherever you store your phplist file) is not accessible to the webuser - hence not putting it under the normal phplist public html files - then it's as secure as your server is. If someone else can (without your authorisation) login and gain access to that file then you have a security problem beyond the scope of phplist. :o)

Cafamily
P.S - I'm a "he".
Cafamily
phpList newbie
 
Posts: 3
Joined: 10:25am, Wed 23 Mar, 2005

Postby waznu » 5:45am, Sun 10 Jul, 2005

I made the changes as in the original post, but now my page wont come up at all. I added a zero to the miliseconds and now I cannot get the page to load at all, i even went back and took out the extra zero. I just get a blank page
waznu
phpLister
 
Posts: 14
Joined: 9:26pm, Tue 21 Jun, 2005

Re: Error Message

Postby abaykamau » 1:17pm, Sun 10 Jul, 2005

I've been receiving the same message as linsys. Has anyone come up w/ a solution for it?

linsys wrote:I'm now getting this message:


PHPlist version 2.8.12 (c) 2000-2005 Tincan Ltd, http://www.phplist.com
Usage: /export/www/customers/email.americanitsolutions.us/htdocs/lists/admin/index.php -p page [other parameters]

Additionally, if I run the following from my commandline
Code: Select all
php /home/public_html/phplist/294/admin/index.php login=USERNAME password=PASSWORD -p processqueue

I receive a full output of the HTML code, and nothing triggers; any suggestions?
abaykamau
PL Geek
 
Posts: 104
Joined: 3:09am, Mon 15 Nov, 2004
Location: Baltimore, MD

cron command line

Postby gscerb » 9:15pm, Sun 10 Jul, 2005

Security issues forced my host to disable access to 'wget'.
I was denied access to the 'bin' folder which was necessary to run the phplist script.
In addition, the CLI version of PHP was not installed.

But this option below worked for me.

In the config.php file I edited the following settings. This sent 200 emails, spaced 15 seconds apart, every hour.
define("MAILQUEUE_BATCH_SIZE",200);
define("MAILQUEUE_BATCH_PERIOD",3600);
define('MAILQUEUE_THROTTLE',15);

I set the cron to execute every hour.

I entered the command below on the command line. The 'GET' command should be in capitals. Edit the remaining CAPITALIZED ITEMS to reflect your site. I also asked my host to enable the necessary GET permissions for me.

GET 'http://MYSITE.COM/MYPHPLISTFOLDER/admin/index.php?page=processqueue&login=MYUSERNAME&password=MYPASSWORD'
gscerb
phpList newbie
 
Posts: 2
Joined: 2:50am, Wed 21 Jan, 2004

Postby SommerNyte » 11:02pm, Mon 01 Aug, 2005

staticfiends wrote:now it gives me this sent to me: :shock:

Code: Select all
Content-type: text/html
X-Powered-By: PHP/4.3.10
Set-Cookie: PHPSESSID=b5f14d33e1a5c188f1fed91fb37e5baf; 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

<!-- using ../config/config.php -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html><head>
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="pragma" content="no-cache">
<link rev="made" href="mailto:phplist%40tincan.co.uk">
<link rel="home" href="http://www.phplist.com" >
<link rel="copyright" href="mailto:phplist%40tincan.co.uk" >
<meta name="Author" content="Michiel Dethmers - http://www.phplist.com">
<meta name="Copyright" content="Michiel Dethmers, Tincan Ltd - http://tincan.co.uk">
<meta name="Powered-By" content="PHPlist version 2.8.12">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" type="text/javascript" src="js/select_style.js"></script><meta http-equiv="Cache-Control" content="no-cache, must-revalidate"><meta http-equiv="Pragma" content="no-cache"><title>PHPlist :: PHPlist :: Send message queue</title><link href="styles/phplist.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#ffffff" background="images/bg.png">
<a name="top"></a>
<div align=center>
<table cellspacing=0 cellpadding=0 width=710 border=0>
<tr>
<td bgcolor="#000000" rowspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td>
<td bgcolor="#000000"><img height=1 alt="" src="images/transparent.png" width=708 border=0></td>
<td bgcolor="#000000" rowspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td>
</tr>

<tr valign="top" align="left">
<td>
<!--TOP TABLE starts-->
<TABLE cellSpacing=0 cellPadding=0 width=708 bgColor="#ffffff" border=0>
  <TR vAlign=top>
    <TD colSpan=2 rowspan="2" height="63" background="images/topstrip.png"><a href="http://www.phplist.com" target="_blank"><img src="images/masthead.png" border=0 width=577 height=75 alt=""></a></TD>
    <TD align=left
      background="images/topstrip.png" bgcolor="#F0D1A3"><FONT
      size=-2>&nbsp;<I>powered by: </I><BR>&nbsp;<B>[<a class=powered
      href="http://www.php.net/" target=_new><I>PHP</I></a>]</B> + <B>[<a
      class=powered href="http://www.mysql.com/"
      target=_new>mySQL</a>]</B></FONT></TD></TR>
  <TR vAlign=bottom>
    <TD vAlign=bottom width=132
    background="images/topright.png" bgcolor="#F0D1A3"><SPAN
      class=webblermenu>PHPlist</SPAN></TD></TR>
  <TR>
    <TD bgColor="#000000"><IMG height=1 alt=""
      src="images/transparent.png" width=20
      border=0></TD>
    <TD bgColor="#000000"><IMG height=1 alt=""
      src="images/transparent.png" width=576
      border=0></TD>
    <TD bgColor="#000000"><IMG height=1 alt=""
      src="images/transparent.png" width=132
      border=0></TD></TR>
  <TR vAlign=top>
    <TD>&nbsp;</TD>
<td><div align=left>
<br />
<p class="leaftitle">PHPlist - send message queue</p><div><font style="font-size : 12px;font-family : Arial, Helvetica, sans-serif;        font-weight : bold;"> good afternoon ause</font></div><div align="right"><a href="./?page=logout&PHPSESSID=b5f14d33e1a5c188f1fed91fb37e5baf">logout</a></div><script language="javascript" type="text/javascript">
onerror = null;
this.onerror = null;
</script>
<script language="Javascript" src="js/progressbar.js" type="text/javascript"></script><form method=post name="outputform"><textarea name="output" rows=22 cols=75></textarea></form>


I am having the same issue - I get a huge HTML formatted email sent to you when the job runs. What have I done wrong?

In the beginning of the instructions, it says to create a file called "phplist" - is that just "phplist" or is it supposed to be "phplist.php"?
SommerNyte
PL Nut
 
Posts: 15
Joined: 11:00pm, Mon 01 Aug, 2005

Postby jotazzu » 1:35am, Tue 02 Aug, 2005

Please read post
http://www.phplist.com/forums/viewtopic.php?p=8040#8040
and ignore the additions which relate to version 2.9.4.

Daniela described a solution which does not need the executable shell script 'phplist', although she described the necessary changes. Her solution is a call to the CGI interface of PHP.

If you use the shell script it is a call to the CLI interface of PHP. The shell script is part of the distribution of PHPlist and resides in the folder PHPlist-2.8.12/bin/ which is parallel to the folder public_html.

For an explanation of the different PHP interfaces see
http://www.phplist.com/forums/viewtopic ... 0191#10191
Last edited by jotazzu on 4:33pm, Tue 02 Aug, 2005, edited 1 time in total.
jotazzu
PL Master
 
Posts: 183
Joined: 6:31pm, Wed 13 Jul, 2005
Location: Hamburg, Germany

Postby SommerNyte » 3:20am, Tue 02 Aug, 2005

I already had my host set up the cron job, so I hate to have to request they change it. Is there a way to make this work with the cron job listed in this thread?
SommerNyte
PL Nut
 
Posts: 15
Joined: 11:00pm, Mon 01 Aug, 2005

Postby jotazzu » 4:30pm, Tue 02 Aug, 2005

To which cron job example do you relate? Are you using CPanel or similiar?
There is one example from SWI:
Code: Select all
45 * * * * * php /home/u5/mydir/html/phplist/public_html/lists/admin/index.php page=processqueue login=username password=password

There is a star to much so the cron tries to call the program * and not php. If you delete it, it is a call to the CGI interface of PHP. If the CLI interface of PHP is installed instead, it would result in a message of PHPlist like:
PHPlist version 2.8.12 (c) 2000-2005 Tincan Ltd, http://www.phplist.com
"Usage: /home/u5/mydir/html/phplist/public_html/lists/admin/index.php -p page [other parameters]".

Also sterlinged describes a method how to check this. If you are using this kind of call and have big subscriber lists (processing needs about 10 min)
please read my post about solutions for batch/cron processing

The other example is from Cafamily:
Code: Select all
# every hour at 15 minutes past we process the queued messages
15 * * * * /usr/local/scripts/phplist -p processqueue

This is a call to the shell script 'phplist' with the right parameter for the page to process if the CLI version of PHP is installed.


P.S.
If you want to omit the output of your cron append >/dev/null at the end of the line of each cron schedule.
jotazzu
PL Master
 
Posts: 183
Joined: 6:31pm, Wed 13 Jul, 2005
Location: Hamburg, Germany

Postby abaykamau » 3:34pm, Wed 03 Aug, 2005

Interesting thing is, I have the CLI version, however, unless I'm physically processing (i.e. php /home/public_html/phplist/admin/index.php -pprocessqueue) via SSH because cron results just spits out an HTML page that tells me "This document requires you to log in". This sucks as its just like clicking process queue from the admin section.

Interestingly, I've tried all versions of the cron jobs found on the forum, however, none of them have successfully triggered the processing of an email. However, if I take the same commands and execute it from the commandline, it works.

Thoughts ':?:'
abaykamau
PL Geek
 
Posts: 104
Joined: 3:09am, Mon 15 Nov, 2004
Location: Baltimore, MD

Postby jotazzu » 5:04pm, Wed 03 Aug, 2005

Hi,

abaykamau. In CLI mode another authentification method is required than with CGI.
Cafamily has described a solution in his post at topic 3. He uses the solution with the shell script. But that script is not necessary. You can insert all this in one single line at the cron schedule ;). Separate different commands by a semicolon ';'. This becomes a ugly long line but works. Cafamily's post also describes how to add 'listprocessor' to config.php. This is necessary to get this to work.

A crontab with a direct call to the CLI would look like (one call has to be in one line):
Code: Select all
#
# crontab for processing all messages with status 'queued' with PHP-cli
# (MAILQUEUE_BATCH_SIZE=0 is recommended).
# All emails will be send in one run. First processing starts at 17 min after midnight and continues
# as long as subscribers have to be processed. Second job starts precisely at high noon.
# Setting up multiple entries at different hours repeats the whole send process multiple times
# a day. Be sure that enough time has passed that the previous job has finished before scheduling
# the next.
#
17 0 * * * USER=listprocessor; export USER; /usr/bin/php /home/mydomain/public_html/phpList/admin/index.php -pprocessqueue -c/home/mydomain/public_html/phpList/config/config.php >/dev/null
00 12 * * * USER=listprocessor; export USER; /usr/bin/php /home/mydomain/public_html/phpList/admin/index.php -pprocessqueue -c/home/mydomain/public_html/phpList/config/config.php >/dev/null

Hope you get your cron job done
Jochen
jotazzu
PL Master
 
Posts: 183
Joined: 6:31pm, Wed 13 Jul, 2005
Location: Hamburg, Germany

Postby abaykamau » 5:57pm, Wed 03 Aug, 2005

Hmmm. Might be closer. First I got
Code: Select all
Status: 404
Content-type: text/html
X-Powered-By: PHP/4.3.11

No input file specified.

Recall someone addressing this before.

Now I get
Code: Select all
This document requires you to log in

again.
abaykamau
PL Geek
 
Posts: 104
Joined: 3:09am, Mon 15 Nov, 2004
Location: Baltimore, MD

Postby jotazzu » 6:52pm, Wed 03 Aug, 2005

Do a search in the forum for 'commandline_users' this is the entry in config.php. There is a quit brutal method to get access. Just allow the user with no name (blank) to run the script.

Try this to get access anyway. Afterwards you may find a way to set it to a more typical user name.

Use the search option to display posts and not the whole topics. Also set the amount of displayed text to 700 or 1000.
jotazzu
PL Master
 
Posts: 183
Joined: 6:31pm, Wed 13 Jul, 2005
Location: Hamburg, Germany

Postby SommerNyte » 9:27pm, Wed 03 Aug, 2005

Most of this is so beyond me. :( Is there someone who can help a simple girl get her scrpit to work?

I followed the instructions in post #1 to the letter, and when I created my file, I called it phplist (with no extention or anything). Cron job set up as written (I changed to match my server settings, of course). Cron job runs, but I just get a huge email with HTML code as the result. :(
SommerNyte
PL Nut
 
Posts: 15
Joined: 11:00pm, Mon 01 Aug, 2005

Postby jotazzu » 9:44pm, Wed 03 Aug, 2005

Thats good. Try to find the interesting text within this bulk of HTML.

Start a little bit above the end because at the beginning and end of a HTML page are only the header and footer which you see also in a standard browser. Somewhere you must find two or three sentences (probably not at the beginning of a line) which you normally see easily with your browser.

If they say there is a login error the problems are not all solved. If you find sentences like

Total processed: xxxx

or the stuff you see when emails are processed you are nearly finished.
jotazzu
PL Master
 
Posts: 183
Joined: 6:31pm, Wed 13 Jul, 2005
Location: Hamburg, Germany

PreviousNext

Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest