[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 marcoseduardo » 8:28pm, Fri 27 Jan, 2012

FIRST OF ALL!!!
Verify if your PHP is GCI or CLI.

This DON'T work with PHP CGI.

If you have PHP CGI or you dont know, please see this topic:
http://forums.phplist.com/viewtopic.php?f=6&t=24643
marcoseduardo
phpLister
 
Posts: 5
Joined: 3:38pm, Mon 19 Jul, 2010

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

Postby Gemini23 » 1:47pm, Wed 16 May, 2012

Hi.. my config.php just shows the follow...

?>
commandline

do I just change that for the code you have shown?
Gemini23
phpLister
 
Posts: 11
Joined: 9:02pm, Fri 04 May, 2012

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

Postby wkriski » 11:00pm, Mon 17 Dec, 2012

Just curious, why doesn't the wget work as described in the docs? it only works when I paste the url in the browser so seems like wget is the issue, at least on hostgator.

I get:

--2012-12-17 16:00:01-- http://www.willkriski.com/phplist/?p=arh
Resolving www.willkriski.com... 174.120.41.62
Connecting to www.willkriski.com|174.120.41.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html?p=arh.5'

0K 52.7M=0s

2012-12-17 16:00:02 (52.7 MB/s) - `index.html?p=arh.5' saved [848]
wkriski
phpLister
 
Posts: 6
Joined: 9:46pm, Wed 11 Nov, 2009

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

Postby mrmckoy » 5:35pm, Tue 18 Dec, 2012

What control panel are you using for your cron? Is it cpanel or command line?

wkriski wrote:Just curious, why doesn't the wget work as described in the docs? it only works when I paste the url in the browser so seems like wget is the issue, at least on hostgator.

I get:

--2012-12-17 16:00:01-- http://www.willkriski.com/phplist/?p=arh
Resolving www.willkriski.com... 174.120.41.62
Connecting to www.willkriski.com|174.120.41.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html?p=arh.5'

0K 52.7M=0s

2012-12-17 16:00:02 (52.7 MB/s) - `index.html?p=arh.5' saved [848]
mrmckoy
PL Master
 
Posts: 169
Joined: 7:10am, Sat 24 Nov, 2007
Location: Atlanta, GA

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

Postby mkoster » 9:45pm, Tue 16 Apr, 2013

Nothing on the net was working for me, I came across this thread and managed to piece it to gether...


Code: Select all
/usr/local/bin/php -q /home/USERNAME/www/PHPLIST_DIR/admin/index.php -p processqueue -c /home/USERNAME/www/PHPLIST_DIR/config/config.php


No modification to any files (other than the throttling process you want). It took me 3 days to get this to work.
mkoster
phpList newbie
 
Posts: 4
Joined: 2:29pm, Tue 16 Apr, 2013

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

Postby inpa » 8:26am, Wed 08 May, 2013

If anyone is having problem with cron job settings, using online cron job like http://www.easycron.com as an alternative is a good idea.
inpa
phpList newbie
 
Posts: 2
Joined: 8:10am, Wed 08 May, 2013

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

Postby abdel65 » 5:27pm, Tue 14 May, 2013

Hi everybody,

I am a newbie who needs your help.
I added a Cron Job using cPanel and inserting the command below:
php /home/myUsernameHosting/public_html/myPhplistFolder/admin/index.php -pprocessqueue

Hereunder you can see the email I got from Cron, and need help analysing the message to know what is wrong, and how to fix this issue. Thanks in advance to anybody who can assist me to get the cron work for me.

Here is the Cron message:
Set-Cookie: PHPSESSID=506da6996137f028bc8511eb4a184c1d; 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:info%40phplist.com" />
<link rel="home" href="http://www.phplist.com" title="phplist homepage" />
<link rel="copyright" href="http://phplist.com" 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, phpList Ltd - http://phplist.com" />
<meta name="Powered-By" content="phplist version 2.10.19" />
<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 :: sahars 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="be-nl" >Dutch - Belgium</option><option value="cn" >Simplified Chinese</option><option value="da" >Danish</option><option value="de" >German</option><option value="en" selected>English </option><option value="es" >Spanish</option><option value="fa" >Persian</option><option value="fr" >French</option><option value="hu" >Hungarian</option><option value="it" >Italian</option><option value="ja" >Japanese</option><option value="nl" >Dutch</option><option value="pl" >Polish</option><option value="pt-br" >Portuguese </option><option value="vi" >Vietnamese</option><option value="zh-tw" >Traditional Chinese</option></select></form></div><p class="information">This document requires yo
u to log in</p>
<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://phplist.com" target="_phplist" class="urhere">phplist limited</a> | <span class="urhere">phplist powered by </span><a class="urhere" href="http://www.phplist.com" target="_blank">phplist</a> - version 2.10.19</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>
abdel65
phpLister
 
Posts: 8
Joined: 2:58pm, Thu 09 May, 2013

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

Postby maheshso » 3:36am, Sun 22 Dec, 2013

hi,

i created a cron job like below
"/usr/bin/php /home/maheshso/public_html/lists/admin/index.php -pprocessqueue"

and i just got mail after run that cron job but not executed message in my queue. please help me.

this is the mail i got.
X-Powered-By: PHP/5.4.22
Set-Cookie: PHPSESSID=77beaad77e3d8d40d5d4e9f1df60e5d2; 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
X-UA-Compatible: IE=Edge
X-Robots-Tag: noindex
Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<link rev="made" href="mailto:info%40phplist.com" />
<link rel="home" href="http://www.phplist.com" title="phplist homepage" />
<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, phpList Ltd - http://phplist.com" />
<meta name="Powered-By" content="phplist version 3.0.5" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="SHORTCUT ICON" id="favicon" href="./images/phplist.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<!-- initial styles and JS from basic application -->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.1.all.min.js"></script>
<script type="text/javascript" src="js/jquery.tools.scrollable.js"></script>
<script language="Javascript" type="text/javascript" src="js/phplistapp.js"></script>
<link rel="stylesheet" href="css/reset.css" />
<link href="css/jquery-ui-1.8.1.all.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/menu.css" />

<!-- now override the above with the styles and JS from the UI theme -->
<script language="Javascript" type="text/javascript" src="ui/dressprow/js/jquery.tablednd.js"></script>
<script language="Javascript" type="text/javascript" src="ui/dressprow/js/phplist.js"></script>
<link rel="stylesheet" href="ui/dressprow/css/base.css" />
<link rel="stylesheet" href="ui/dressprow/css/layout.css" />
<link rel="stylesheet" href="ui/dressprow/css/skeleton.css" />
<link rel="stylesheet" href="ui/dressprow/css/style.css" />
<link rel="stylesheet" href="ui/dressprow/css/gray.css" />

<!-- Style for rtl language <link rel="stylesheet" href="ui/dressprow/css/style_rtl.css" /> -->

<title>phpList :: phpList :: Dashboard</title><script type="text/javascript" src="ui/dressprow/js/jcarousellite_1.0.1.min.js" ></script>
<link rel="icon" href="./images/phplist.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="./images/phplist-touch-icon.png" />
<link rel="apple-touch-icon-precomposed" href="./images/phplist-touch-icon.png" />
</head>
<body class="login">
<div id="dialog"></div><div id="hiddendiv"></div>

<div id="container" class="container_24 container">
<div id="header" class="grid_24 sixteen columns">
<div id="logo"><a href="http://www.phplist.com" target="_blank"><img src="ui/dressprow/images/branding.png" alt="phpList, email newsletter manager, logo" title="phpList, the world's most popular Open Source newsletter manager" /></a></div>
<div id="logged">
<a id="login" href="./?page=home">Login</a> </div>
</div>
<!-- end .grid_24 -->
<div class="clear"></div>
<div id="navigation" class="grid_24 sixteen columns">
<div id="main-menu" class=" fourteen columns alpha">
</div>
<div class="two columns omega">
<span id="menu-button"><span>Menu</span></span>
</div>
</div>
<div id="globalhelp">
<div class="content">
<div class="text">
<p>Please login to continue</p>
</div>
</div>
<div class="buttonhelp open">HELP</div>
<div class="buttonhelp close">HELP</div>
</div>
<div class="clear"></div>
<div id="content" class="grid_20 twelve columns">
<div id="wrapp">
<div id="progressbar"></div>
<!-- content start here -->
<h4 class="pagetitle">dashboard</h4><noscript><div class="note d533fc9acf638d1"><a href="./?page=login&amp;action=hidenote&amp;note=d533fc9acf638d1" class="hide ajaxable" title="Close this box" />Hide</a><p>phpList will work without Javascript, but it will be easier to use if you switch it on.</p></div></noscript><div ></div>

<script language="Javascript" type="text/javascript">
//<![CDATA[
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" id="login-form" action="">
<input type="hidden" name="page" value="home" />
<table class="loginPassUpdate" 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" autofocus="autofocus" /></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 class="submit" type="submit" name="process" value="Continue" /></td></tr> </table></form><form method="post" id="forgotpassword-form" action=""><div class="login"><p>Forgot password Enter your email address: </p><input type="text" name="forgotpassword" value="" size="30" /> <input class="submit" type="submit" name="process" value="Send password" /> <div class="clear"></div></div></form>

<!----> </div>
</div> <!-- end #content -->

<div id="right-bar" class="grid_4 four columns">
<div id="context-menu" class="menutableright block">
<h3>Navigation</h3>
<ul class="contextmenu"><li class="shade0"><a href="./?page=home" title="Dashboard">Main page</a><br /></li><li class="shade0"><a href="./?page=about" title="About phpList">About phpList</a><br /></li></ul> </div>
<div id="recent" class="menutableright block">
</div>
<div id="language">

<div id="languageswitcher">
<form name="languageswitchform" method="post" action="">
<select name="setlanguage" onchange="document.languageswitchform.submit()">
<option value="ca" >Català</option>
<option value="da" >danske</option>
<option value="de" >Deutsch</option>
<option value="en" selected="selected">english</option>
<option value="es" >espa&ntilde;ol</option>
<option value="es_AR" >espa&ntilde;ol (Argentina)</option>
<option value="fr" >française</option>
<option value="it" >italiano</option>
<option value="hu" >magyar</option>
<option value="nl" >Nederlands</option>
<option value="pl" >polski</option>
<option value="pt_BR" >portugu&ecirc;s (Brazil)</option>
<option value="sl" >Slovenian</option>
<option value="fi" >suomi</option>
<option value="sv" >svenska</option>
<option value="zh_TW" >Traditional Chinese</option>
<option value="vi" >Việt</option>
<option value="nl_BE" >Vlaams</option>
<option value="el" >ελληνικά</option>
<option value="ru" >русский</option>
<option value="he" >עברית</option>
<option value="ar" >العربية</option>
<option value="fa" >فارسی</option>
<option value="ja" >日本語</option>
<option value="zh_CN" >简体中文</option>
</select>
</form>
</div> </div>
</div><!-- end #right-bar -->

<div class="clear"></div>

</div> <!-- end #container -->

<div id="footer">
<div class="container">
<a target="_blank" href="http://phplist.com">&copy; phpList ltd.</a> - v3.0.5 <div class="right">
<a target="_blank" href="http://resources.phplist.com">Resources</a>&nbsp; |
<a target="_blank" href="http://www.twitter.com/phplist"><img src="ui/dressprow/images/twitter.png" /></a>
</div>
</div>
</div>
</body></html>
maheshso
phpList newbie
 
Posts: 1
Joined: 12:47pm, Tue 04 Jun, 2013

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

Postby duncanc » 8:48am, Mon 23 Dec, 2013

The HTML output means that your cron command is running php CGI, not php CLI.

See this post http://forums.phplist.com/viewtopic.php?f=35&t=40023#p98723 for what to try for the php CLI command
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

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

Postby deepaksakhrani » 8:46am, Fri 27 Dec, 2013

Hello Everyone... I am sure there are many others who are struggling to put a working cron job command line in place. I wanted to share my working command lines that may help someone...

This is working on CENTOS 6.0 server with CPANEL. My php list is installed on a sub-domain in root folder so you will need to change the sub-folder path as applicable to your installations.

In config.php set commandline_users as
$commandline_users = array();

To process queue with cron

php-cli -d register_globals=0 /home/CPANEL_USERNAME/public_html/admin/index.php -pprocessqueue -c/home/CPANEL_USERNAME/public_html/config/config.php

To process bounces with cron

php-cli -d register_globals=0 /home/CPANEL_USERNAME/public_html/admin/index.php -pprocessbounces -c/home/CPANEL_USERNAME/public_html/config/config.php

Hope this will help someone to resolve their issues.

Best wishes,
Deepak Sakhrani
deepaksakhrani
phpList newbie
 
Posts: 1
Joined: 8:19am, Fri 27 Dec, 2013

Previous

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

cron