[how to] get phplist working with cpanel cron

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

Re: [how to] get phplist working with cpanel cron

Postby BOWZONE » 4:38pm, Thu 31 Dec, 2009

Well, I've followed each and every post in here regarding this issue and tried all of the work arounds and still when the cron job executes, it sends an email out to me that I've posted below.

PHPLIST 2.10.10
PHP 5.2.11
CPANEL CONTROL PANEL
HOSTGATOR

Any thoughts would be appreciated.

Scott


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

<!-- 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" title="phplist homepage" /> <link rel="copyright" href="http://tincan.co.uk" title="Copyright" /> <link rel="license" href="http://www.gnu.org/copyleft/gpl.html" title="GNU General Public License" /> <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.10.10" /> <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 :: Main Admin Page</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 - main admin page</p><div align="right" id="languageswitch"><br/><form name="languageswitch" method="post" style="margin: 0; padding: 0"><select name="setlanguage" onChange="document.languageswitch.submit()" style="width: 100px; font-size: 10px; color: #666666"><option value="nl" >Dutch </option><option value="de" >Deutsch </option><option value="en" selected>English </option><option value="es" >espa&ntilde;ol</option><option value="fr" >fran&ccedil;ais </option><option value="pt-br" >portugu&ecirc;s </option><option value="zh-tw" >Traditional Chinese</option></select></form></div><p>This document requires you to log in<br/> <font class="error"></font>


<script language="Javascript" type="text/javascript">

if (!navigator.cookieEnabled) {
  document.writeln('<div class="error">In order to login, you need to enable cookies in your browser</div>'); }

</script>
<form method="post" action="">
<input type=hidden name="page" value="home"> <table width=100% border=0 cellpadding=2 cellspacing=0>

<tr><td><span class="general">Name:</span></td></tr>
<tr><td><input type=text name="login" value="" size=30></td></tr>

<tr><td><span class="general">Password:</span></td></tr>
<tr><td><input type=password name="password" value="" size=30></td></tr>

<tr><td><input type=submit name="process" value="Enter"></td></tr></table> </form>


<form method="post" action="">
<input type="hidden" name="page" value="home"> <p align="center"><hr width=50% size=3>

Forgot Password?:

Enter your email: <input type=text name="forgotpassword" value="" size=30>


<input type=submit name="process" value="Send Password">

</form></div>
</td>
<td>
<div class="menutableright">
<span class="menulinkleft"><a href="./?page=home">main page</a><br /></span><span class="menulinkleft"><a href="./?page=about">about phplist</a><br /></span></div> </td> </tr>




<tr><td colspan="4">&nbsp;</td></tr>



<tr><td colspan="4">&nbsp;</td></tr>
</table>
<!--TOP TABLE ends-->

</td></tr>


<tr>
<td bgcolor="#000000" colspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td> </tr>

<tr>
<td bgcolor="#000000"><img height=1 alt="" src="images/transparent.png" width=1 border=0></td> <td bgcolor="#ff9900" class="bottom">&copy; <a href="http://tincan.co.uk" target="_tincan" class="urhere">tincan limited</a> | <span class="urhere">phplist powered by </span><a class="urhere" href="http://www.phplist.com" target="_blank">phplist</a> - version 2.10.10</td> <td bgcolor="#000000"><img height=1 alt="" src="images/transparent.png" width=1 border=0></td> </tr>

<tr>
<td bgcolor="#000000" colspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td> </tr>

<tr>
<td colspan=3><img height=3 alt="" src="images/transparent.png" width=1 border=0></td> </tr>

<tr>
<td colspan=3>
&nbsp;
</td>
</tr>
</tbody>
</table>

</div>
</body></html>
BOWZONE
phpList newbie
 
Posts: 2
Joined: 11:24pm, Wed 09 Aug, 2006

Re: [how to] get phplist working with cpanel cron

Postby trickleup » 6:53am, Fri 26 Feb, 2010

Hi,

Thanks for a good thread. I'm running phplist 2.10.10 on siteground hosting using cpanel.

This is my cron job commandline today:

/usr/bin/php /home/USER/public_html/phplist/admin/index.php -pprocessqueue -c/home/USER/public_html/phplist/config/config.php

I have no trouble with the cron or with PHP, I get my confirmation email and index.php script is running and returns the results in the confirmation email, but it returns the login page (same as bowzone posted above), not the processqueue page. So it seems to me I'm not getting in because of the php access restrictions... not the unix ones, since I'm allowed to run the script.

I've tried pretty much all versions of the commandline syntax that I have found in these forums. I've also tried this before the commandline string above:

USER=*USERNAME*; export USER;

I have tried both to specify the username in config.php, and to use the empty brackets as indicated above.

Anyone that has any more information?
trickleup
phpList newbie
 
Posts: 2
Joined: 6:05am, Fri 26 Feb, 2010

Re: [how to] get phplist working with cpanel cron

Postby urmark » 3:14am, Tue 23 Mar, 2010

Hello,

I have Phplist hosted on Hostgator and these where my settings for cronjobs

cd '/home/XXXXXX/public_html/mailing/admin/' ; php -q index.php -p processqueue > /dev/null ;

and after the instruction followed on this thread

/usr/local/bin/php /home/XXXXXX/public_html/mailing/admin/index.php -p processqueue

I send a mailing campaign but so for it's not working, what should I do ?

Thanks
urmark
phpLister
 
Posts: 9
Joined: 5:38pm, Sat 30 Jan, 2010

Re: [how to] get phplist working with cpanel cron

Postby urmark » 12:14pm, Tue 23 Mar, 2010

Hello,

I setup the cron jobs and receive email status every hour but it does not send the messages, this is what the email looks like

PHPlist version 2.10.10 (c) 2000-2010 Tincan Ltd, http://www.phplist.com
Usage: /home/XXXXXXX/public_html/mailing/admin/index.php -p page [other parameters]


Please help!

Thanks
urmark
phpLister
 
Posts: 9
Joined: 5:38pm, Sat 30 Jan, 2010

Re: [how to] get phplist working with cpanel cron

Postby ozetrade » 12:55pm, Thu 15 Apr, 2010

Like many, I have trolled the forum looking for the right answer to getting my cronjob working with PHPList. I do understand that different server setups need varied configurations, but the following has worked for me.

Just so others may know, these are my software versions
PHP Version: 5.2.11 (Zend: 2.2.0)
PHPList version 2.10.11

I'm only providing my experience at getting cron working with cPanel, you will have to sort out how to configure the auto scheduling as everyones needs are different.

First thing that needs to be done is an admin user needs to be setup in PHPList. Once you have done this, change that users permission so it has rights to run processqueue - this MUST be done.

Next you need to edit admin/config/config.php and change the following settings to match these:

# YOUR_POP_SERVER on a linux server will probably look something like this mail.yourserver.com
$bounce_mailbox_host = 'YOUR_POP_SERVER';

# On a Linux server you will need to put a complete email address
$bounce_mailbox_user = 'user@yourdomain.com';

# Your email account password
$bounce_mailbox_password = 'PASSWORD';

# Now change USERNAME in the following line to match the new PHPList admin user you setup earlier.
$commandline_users = array(USERNAME);

# The comments in config.php for this line are a bit misleading, setting to "0" stops it working - leave it set as "1"
define ("MANUALLY_PROCESS_QUEUE",1);

My cron has been setup with cPanel, so I can only provide my experience with that.

I have set my cron to run every hour 0 * * * *
Set this to 1 minute initially for testing.

The string I have used is
/usr/bin/php -q /home/MYUSERFOLDER/public_html/lists/admin/index.php page=processqueue login=USERNAME password=PASSWORD
NOTE: USERNAME and PASSWORD are those of the new PHPList admin you setup.

This cronjob sends me an email with html content of the processqueue page that indicates that I successfully logged in and the scheduled jobs are processed. If you don't know how to get that html code to display so you can read it, don't bother with it, just see if your scheduled job has been process by looking in PHPList's Event Log.

Once you are satisfied that it is working, you can add >/dev/null to the end of the cron string so you don't get those annoying emails anymore.

Example:
/usr/bin/php -q /home/MYUSERFOLDER/public_html/lists/admin/index.php page=processqueue login=USERNAME password=PASSWORD >/dev/null

Now setup a test email schedule in PHPList and test.

I do hope this helps a lot of you.

Cheers,
OZ
ozetrade
phpList newbie
 
Posts: 1
Joined: 12:05pm, Thu 15 Apr, 2010

Re: [how to] get phplist working with cpanel cron

Postby johnhdsc » 2:28am, Sat 01 May, 2010

Re: cron daemon message = code for index page & messages not sent.
Solution: add login and password at end of command line (login= XXX password=XXX) EVEN IF command line users is set to array().

I had this problem, even though the "command line user = array()" was set (nothing in brackets). I set up a new admin user whose only privilege is to run the processqueue; I did not change the config.php file (config.php still has the "array()" setting); included the login/password in the command line. This got the messages sending.

Thanks to everyone for the great advice on setting up the command line(s)
johnhdsc
phpList newbie
 
Posts: 3
Joined: 6:42pm, Fri 16 Apr, 2010

Re: [how to] get phplist working with cpanel cron

Postby geekeleh » 12:42am, Mon 10 May, 2010

Followed ozetrade's directions, with changes in the path to reflect my install. I am happy to say it worked. Thank you.
geekeleh
phpList newbie
 
Posts: 1
Joined: 12:29am, Mon 10 May, 2010

Re: [how to] get phplist working with cpanel cron

Postby weightlossbenefits » 3:05am, Mon 24 May, 2010

This phrase really saved my day: Once you are satisfied that it is working, you can add >/dev/null to the end of the cron string so you don't get those annoying emails anymore.

Because for three days I have been trying to fix it and stubborn that I am, did not wanted to ask for help, but I found you and now I can continue dealing with other issues whose answers are probably included around here.

Thanks a lot guys! :mrgreen:
weightlossbenefits
phpList newbie
 
Posts: 1
Joined: 2:29am, Mon 24 May, 2010

Re: [how to] get phplist working with cpanel cron

Postby ingoio256 » 2:30am, Sat 05 Jun, 2010

Thank you very much, I tried the instructions on the official page (which explain mostly what a cron job is and not what to exec with it or how to configure phplist) with no luck.
Following your instructions it worked at first attempt!

Now I'm just wondering how to disable links to manually process queue... I guess I'll find that in configuration
ingoio256
phpList newbie
 
Posts: 1
Joined: 10:02pm, Thu 04 Mar, 2010

Re: [how to] get phplist working with cpanel cron

Postby Degsx » 4:34pm, Wed 30 Jun, 2010

Muchas gracias ozetrade, solo me funciono la solucion que explicaste. Las demas opciones que probe, ninguna funcionaba.
Degsx
phpList newbie
 
Posts: 1
Joined: 4:31pm, Wed 30 Jun, 2010

Re: [how to] get phplist working with cpanel cron

Postby rldev » 3:09pm, Thu 01 Jul, 2010

This worked perfect. Thanks.

Do I need to setup a separate cron for a list with a different admin?

Also does this cron simply use defaults or do I have to add something to the cron to use the config.php values? I ask because the cron is using the default email address in the config rather than using the configured email address of the user.
rldev
PL Nut
 
Posts: 15
Joined: 10:04pm, Tue 22 Jun, 2010

Re: [how to] get phplist working with cpanel cron

Postby crowdofone » 11:51am, Tue 20 Jul, 2010

It seems that after a while i don't receive email replies automatically and have to check the topic by hand - hence the late reply - however...

rldev wrote:Do I need to setup a separate cron for a list with a different admin?

If your using $commandline_users = array(); then it doesn't matter what admin owns the list, the lists are effectively processed by a superadmin. If there are two phplist installations at different locations then you will obviously need separate Cron commands.

rldev wrote:Also does this cron simply use defaults or do I have to add something to the cron to use the config.php values? I ask because the cron is using the default email address in the config rather than using the configured email address of the user.

The email address specified for Cron is only used for messages about Cron and not related to the functioning of Phplist
crowdofone
PL Nut
 
Posts: 16
Joined: 9:20pm, Thu 30 Aug, 2007

Re: [how to] get phplist working with cpanel cron

Postby email2vicky » 9:27pm, Thu 22 Jul, 2010

I am getting the following error message

PHPlist version 2.10.12 (c) 2000-2010 Tincan Ltd, http://www.phplist.com

Error: Sorry, You (siteusername) do not have sufficient permissions to run phplist on commandline




This is the cron i am running
/usr/local/bin/php /home/xxx/public_html/xxx/phplist/admin/index.php -pprocessqueue -c/home/xxx/public_html/xxx/phplist/config/config.php
email2vicky
phpList newbie
 
Posts: 2
Joined: 4:45pm, Thu 22 Jul, 2010

Re: [how to] get phplist working with cpanel cron

Postby wayneherndon » 8:23pm, Tue 17 Aug, 2010

I'm getting the same html message back with the log in page as was reported by BOWZONE and trickleup. Does anyone have a solution to this?

My cron I am running is:

/usr/bin/php -q /home/XXXXXXX/public_html/XXXXXX/admin/index.php page=processqueue login=XXXXXXXX password=XXXXXX >/dev/null

The login and password I'm using is for a new admin with only processqueue rights.

I'm using this in the config file:

$commandline_users = array();

However, even when I put the user ID in there, it doesn't change anything.

Did anyone else have this issue and was able to solve it?

WH
wayneherndon
phpList newbie
 
Posts: 1
Joined: 8:16pm, Tue 17 Aug, 2010

Re: [how to] get phplist working with cpanel cron

Postby GeeketteGurl » 5:39pm, Wed 06 Oct, 2010

THANK YOU! I can't say that enough. This worked like a charm for me.
GeeketteGurl
PL Nut
 
Posts: 39
Joined: 5:41pm, Wed 20 May, 2009

PreviousNext

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest