Setup Cron

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Setup Cron

Postby tamirzzz » 3:54pm, Mon 23 Jan, 2012

Hi,

I know this topic was discussed many times in the forum, but still, I can not find a solution.

I am trying to set this up using Cpanel with PHP cli installed.

To make a long story short, I have used the following command:

Code: Select all
/usr/bin/php /home/virtual/dwh/public_html/lists/admin/index.php processqueue login=myuser password=mypassword


or

Code: Select all
/usr/bin/php /home/virtual/dwh/public_html/lists/admin/index.php processqueue login=myuser password=mypassword -c/home/virtual/dwh/public_html/lists/config/config.php


And got as a result, a mail from Cron deamon, with an HTML code(not an HTML message!!!) of the PHPlist Welcome screen stating "good afternoon admin".

So, I took a different approach in which I used an php external file called by the Cron.

As a result, I got a message from the Cron Deamon with the following text:

Code: Select all
X-Powered-By: PHP/5.2.17
Content-type: text/html


Needless to say, that in both cases none of the messages were sent.

Could you please help.....it is driving me crazy :roll:


Many thanks,

Tamirzzz
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012

Re: Setup Cron

Postby duncanc » 4:16pm, Mon 23 Jan, 2012

Not sure where you got the example commands from but it is mixing cli and cgi syntax.

If you really do have php cli then the command is like a unix command with parameters starting with -, and you don't specify a login or password just the page and config file.

Code: Select all
/usr/bin/php /home/mydomain/public_html/phpList/admin/index.php -pprocessqueue -c/home/mydomain/public_html/phpList/config/config.php


As you have CPanel it is more likely that you have php cgi, and for that you do specify phplist user and password using http style parameters
Code: Select all
 /usr/bin/php /home/virtual/dwh/public_html/lists/admin/index.php page=processqueue login=myuser password=mypassword


To see whether you have cli or cgi run this command and look at the content of version .txt
Code: Select all
/usr/bin/php -v > version.txt


This is a good place to start in the documentation http://docs.phplist.com/SetupCronJob
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Setup Cron

Postby tamirzzz » 5:31pm, Mon 23 Jan, 2012

Hi,

Thank you for yor reply.

I have php cli installed for sure-I spoke with the sysadmin

I have tried what you wrote:

Code: Select all
/usr/bin/php /home/virtual/dwh/public_html/lists/admin/index.php -pprocessqueue -c/home/dwh/public_html/phpList/config/config.php


As a result, I got the HTML code of phplist user\password screen:

Code: Select all
X-Powered-By: PHP/5.2.17
Set-Cookie: PHPSESSID=99c17daecb031468d676685b263794e8; 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.4" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />

<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="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.4</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>


in addition, I set:

Code: Select all
$commandline_users = array();


Any ideas?!!

Thanks,

Tamir
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012

Re: Setup Cron

Postby duncanc » 5:43pm, Mon 23 Jan, 2012

The fact that you are getting the html for the login page returned indicates that you have php cgi installed, not php cli, despite what you have been told. Possibly you have both installed and /usr/bin/php is running php cgi.

Did you run the version command that I showed?
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Setup Cron

Postby tamirzzz » 5:57pm, Mon 23 Jan, 2012

Thanks.

Could be.

I am not able to run the command, since the Sys admin had bloacked the command line to users.

What next?

Cheers,


Tamir
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012

Re: Setup Cron

Postby duncanc » 6:01pm, Mon 23 Jan, 2012

You can run the version command from a cron job, just set it up to run once in a few minutes time.
But have you tried running the php cgi command using the correct parameter syntax that I showed?
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Setup Cron

Postby tamirzzz » 6:16pm, Mon 23 Jan, 2012

Hi,

Here is the version:

Code: Select all
PHP 5.2.17 (cgi) (built: Dec  6 2011 12:18:24)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.0.9, Copyright (c) 2002-2011, by ionCube Ltd., and
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies


What command should I run?

Thanks
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012

Re: Setup Cron

Postby duncanc » 6:29pm, Mon 23 Jan, 2012

As I suggested it is cgi
tamirzzz wrote:
PHP 5.2.17 (cgi) (built: Dec 6 2011 12:18:24)
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Setup Cron

Postby tamirzzz » 6:59pm, Mon 23 Jan, 2012

OK.

I see, it is getting somewhere:

I tried:

Code: Select all
/usr/bin/php /home/virtual/dwh/public_html/lists/admin/index.php page=processqueue login=myuser password=mypassword


Now I get , the standard phplist welcome page but with a small addittion:

Error: You do not have enough privileges to access this page.


What`s next??

Many thanks,

Tamir
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012

Re: Setup Cron

Postby tamirzzz » 7:57pm, Mon 23 Jan, 2012

Hi,

I managed to figured out what to do using this guide:

http://forums.phplist.com/viewtopic.php?f=6&t=24643

It is working like a charm.

Could not have pulled this without your help!!

Many Thanks :mrgreen: ,


Tamir
tamirzzz
phpLister
 
Posts: 10
Joined: 3:13pm, Mon 23 Jan, 2012


Return to Question & Problems - after installing

Who is online

Users browsing this forum: No registered users and 6 guests