[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

Postby raymon » 10:07pm, Sun 07 May, 2006

I can't find this line in processqueue using phplist 2.10.2:

output("Sending $messageid to $useremail");
sendEmail($messageid,$useremail,$userhash,$htmlpref,$rssitems);
raymon
phpLister
 
Posts: 6
Joined: 10:02pm, Sun 07 May, 2006

no such a line in php 2.10.2

Postby gesualdo » 6:56pm, Thu 18 May, 2006

please someone tell me a solution for this new version?
gesualdo
phpList newbie
 
Posts: 2
Joined: 6:22pm, Thu 18 May, 2006

Postby gram » 12:29am, Sun 28 May, 2006

With latest versions:

There is now a bash script included with PHPlist distros. It is in seperate folder called 'bin' which mus be sperately moved to a suitable location on your server. It also needs to be modified for use on your server with correct paths etc...

Then you should be able to call it using the other instructions included with this thread.

IF YOU GET A PAGE WITH THE HTML CODE EMAILED TO YOU AFTER IT RUNS:

First the good news, your server is parsing the page. That means it knew how to use php to parse the page.

Look through the code to see if it has text in it telling you you need to login. If it says this, look for instructions in this thread on how to modify your shell script (in the bin directory) to forward user information, or set the '$commandline_users = array();' line in your config to be the active one. This will disable user verification.

IF YOU STILL GET A PAGE WITH THE HTML CODE EMAILED TO YOU:

You most likely do not have CLI php on your server. In that event, you probably DO have CGI PHP which should work.

See my post about how to do this at:

http://www.phplist.com/forums/viewtopic.php?t=5440

GRAM
gram
phpLister
 
Posts: 11
Joined: 7:00pm, Fri 26 May, 2006

Postby osarusan » 8:19pm, Mon 12 Jun, 2006

gram wrote:With latest versions:

There is now a bash script included with PHPlist distros. It is in seperate folder called 'bin' which mus be sperately moved to a suitable location on your server. It also needs to be modified for use on your server with correct paths etc...

Then you should be able to call it using the other instructions included with this thread.


Where is this script? I just installed PHPList and it doesn't have any folders called 'bin'... :?
osarusan
phpLister
 
Posts: 11
Joined: 8:52pm, Thu 25 May, 2006

Postby Hernol » 8:24pm, Mon 12 Jun, 2006

There are three folders when you unzip phplist: Bin, Public_html and Scripts.
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Postby osarusan » 8:36pm, Mon 12 Jun, 2006

Ah thank you. I found it and copied it to my phplist folder.

I really don't know anything about cron jobs though. Could you tell me what command I should enter in cPanel for this cron job to work?

Thanks again.
osarusan
phpLister
 
Posts: 11
Joined: 8:52pm, Thu 25 May, 2006

Postby Hernol » 8:44pm, Mon 12 Jun, 2006

I don't know that either, because I never used it.
But you can search in the forum, there's a lot of topics about cron jobs.
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Postby AniG » 12:47pm, Mon 21 Aug, 2006

those who are allowed and/or have SSH access, have you tried the lynx option?

I use this command in my crons [modified]:

lynx -dump 'http://lists.[domain.com]/admin/index.php?page=processqueue&login=[user]&password=[password]' > /dev/null

you will need to change the url to the admin/index.php page and of course use your own username (admin) and password. I use the same for automatically processing bounces. It works perfectly. I have tested it in cPanel accounts on VPSs and shared setups, running CentOS.. the most common cpanel setup out there...

try it..
AniG
PL Nut
 
Posts: 23
Joined: 12:11pm, Wed 30 Mar, 2005

Postby SommerNyte » 5:58pm, Tue 22 Aug, 2006

gram wrote:It is in seperate folder called 'bin' which mus be sperately moved to a suitable location on your server.
Can you define "suitalbe location"? I'm note sure where I am supposed to put this file.

I am upgrading from 2.8 to 2.10, by the way. My cron worked in 2.8, I am now trying to get it to work in 2.10.

Thanks!
SommerNyte
PL Nut
 
Posts: 15
Joined: 11:00pm, Mon 01 Aug, 2005

Postby flug » 12:20am, Mon 28 Aug, 2006

SommerNyte wrote:
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
 . . .


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"?


If you are getting a big blob of HTML code when you try to run phplist via command line (or cron--amounts to the same thing) it means that the admin/index.php file isn't flipping into command line mode properly.

This is a bit of a bug in PHPList which can happen in some server configurations.

Fixing will require just a bit of a mod to PHPlist--you can see how to do it here:

http://forums.phplist.com/viewtopic.php?t=5440
flug
PL Nut
 
Posts: 25
Joined: 12:17am, Mon 28 Aug, 2006

Postby flug » 12:28am, Mon 28 Aug, 2006

SommerNyte wrote:
gram wrote:It is in seperate folder called 'bin' which mus be sperately moved to a suitable location on your server.
Can you define "suitalbe location"? I'm note sure where I am supposed to put this file.

I am upgrading from 2.8 to 2.10, by the way. My cron worked in 2.8, I am now trying to get it to work in 2.10.

Thanks!


"Suitable location" is really anywhere you want, just some directory within your hosting account, if all you care about it 'getting it to work'.

However for security reasons it is usually best to place scripts like this somewhere *outside* the directories where you store your public web pages (typically the "public_html" directory & its subdirectories).

The reason is, scripts like this often have some sort of sensitive information you wouldn't like hackers to find--maybe passwords, usernames, even just hints to the site's internal directory structure.

If that script is within the public_html directory then it can be read just by pointing a web browser at it. Hackers and/or just nosy people do this all this time--looking for stray files that might have interesting information. Or a search engine might pick the file up, and now (assuming your username/pass are within that script) your username/pass is searchable from within google.

All that is just a long way of saying, preferably put it anywhere OTHER THAN within your public_html web directories.
flug
PL Nut
 
Posts: 25
Joined: 12:17am, Mon 28 Aug, 2006

Postby flug » 12:40am, Mon 28 Aug, 2006

SWI wrote:this is my cron job anything wrong with it?

Code: Select all
45 * * * * * php /home/u5/mydir/html/phplist/public_html/lists/admin/index.php page=processqueue login=username password=password



it works at the shell just like that but doesnt for the cron job


One "*" too many. Try this:

Code: Select all
45 * * * * php /home/u5/mydir/html/phplist/public_html/lists/admin/index.php page=processqueue login=username password=password


(note that within your crontab file this will all appear on one line without a line break.
flug
PL Nut
 
Posts: 25
Joined: 12:17am, Mon 28 Aug, 2006

Re: How to make PHPlist work with Cron Jobs

Postby thaivisitor » 3:32am, Tue 05 Sep, 2006

Pardon my ignorance and stupidity and I hope someone here could help me out here.

It has been extremely frustrating for me to built my website (almost a year already), even after engaging 2 different "so-called" expert companies that I had to eventually do up on my own with pratically no prior experiences whatsoever and at the same time losing my hard earned money.

I had a "member registration" function in the website created by the previous companies but all was lost due to their "expertise". Now, on my own, I would like to created a mailing list. I have installed phplist as a subpage of my website as my website is in html and phplist is in php. I have no knowledge on both html & php as I'm using Microsoft Frontpage.

For my mailing list, my shared server allows me to send 400 emails per hour (didn't realised that and was temporarily suspended previously) so I would like to set up my phplist to do just that.

I am trying to follow the instructions as closely as possible so I sincerely appreciate any guidance to unable me to do it correctly as I had to uninstalled and reinstalled phplist a couple of times when I did some other things wrong.

I have read that the instructions from Daniela to be good so I'm trying to use it for my phplist. At the same time guidance is required as I've also read that some of it may not apply to the later version of phplist. I've installed phplist version 2.10.2. as "mailinglist" under my domain "thaivisitor.org".

Now according to Daniela's instruction, I have to create a file "phplist" in the same directory as the phplist installation. I really need a "step by step" directions as to what exactly do I need to do.

In my cpanelX, I open File Manager. Than I open the public_html folder. Then I open "memberlist" list folder as "memberlist" is the directory where I installed phplist thru fantastico. Now I see this folders & files as follows;

(Folder) / public_html / memberlist / (Current Folder)
(Folder) Create New Folder
(Black arrow pointing up) Upload file(s)
(Folder) Up one level
(Folder) admin
(Folder) attachments
(Folder) config
(Folder) images
(Folder) js
(Folder) styles
(Folder) texts
(File) Create New File
(File) .htaccess
(File) dl.php
(File) fantversion.php
(File) index.html
(File) index.php
(File) lt.php
(File) ut.php


What do I do next? Do I click on "Create New File" and name it phplist and insert the script as provided by Daniela? Or some other thing?

I know it's a long post just for one instruction and I haven't even got to the other parts yet but seriously, I am a newbie and I really need to be very careful.

I thank you all for your patience.

ThaiVisitor
thaivisitor
phpLister
 
Posts: 14
Joined: 1:44am, Tue 05 Sep, 2006
Location: Thailand

Postby thaivisitor » 3:58pm, Wed 06 Sep, 2006

With regards to the above, I have already found the solution here
http://docs.phplist.com/PhpListConfigSendRate

It was actually in the "sticky" under "Did you read the documentations?".

Silly me, all I need to do is to read up more and probably the solutions are there.

Cheers
Tee Vee
thaivisitor
phpLister
 
Posts: 14
Joined: 1:44am, Tue 05 Sep, 2006
Location: Thailand

Got it working; FC3, php: cgi

Postby mp459 » 5:02pm, Thu 14 Sep, 2006

Gram: Thanks for your consice information. Now the commandline works. Your thread http://forums.phplist.com/viewtopic.php?t=5440 got me on the right track.

For those of you who are trying it and keep waiting for days for cron to process--try running via commandline first. If that works, getting into cron shouldn't be take much more.

I'm running FC3 and php4.

Here's some steps:
Code: Select all
[mickey@mickey phplist]$ php -v
PHP 4.3.11 (cgi) (built: Aug 25 2005 05:24:19)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
[mickey@mickey phplist]$



If you get that (PHP 4.3.11 (cgi)) output above, then see the aforementioned forum thread. You'll know when it's all fixed when you can get this:
Code: Select all
mickey@mickey phplist]$ phplist-2.10.2/bin/phplist
PHPlist version 2.10.2 (c) 2000-2006 Tincan Ltd, http://www.phplist.com
Usage:  -p page  [other parameters]

[mickey@mickey phplist]$


Then set up your config file with your batches, throttles, and commandline_users, and do phplist -p processqueue.

thanks, again.

mickey[/code]
mp459
PL Nut
 
Posts: 20
Joined: 4:52pm, Thu 14 Sep, 2006
Location: USA/DC

PreviousNext

Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests