Crontab, shared servers and v3

Questions & Problems about Installing or Upgrading with Version 3 phpList.
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.

Crontab, shared servers and v3

Postby ComputingFroggy » 11:46am, Fri 06 Mar, 2015

Hi,

I am running phpList from a shared server (on OVH hosting).
I am sending the emails using a Mandrill SMTP server (see another thread https://forums.phplist.com/viewtopic.php?f=34&t=42125 about that).

I want to get the queue processed automatically. With OVH, one doesn't get much access (no sh etc), but there's a Cron facility to fireup php pages.
With phpList v2, I had the following page in the cron and that worked.

Code: Select all
#!/usr/local/bin/php
<?php
//http://news.mysite.com/admin/?page=processqueue
function process_queue() {
//variables
$domain = "http://news.mysite.com/";
$post_data["page"] = "processqueue";
$post_data["login"] = "admin";
$post_data["password"] = "mypwd.";
$url = $domain . "admin/index.php";

//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);

//clean up
curl_close($ch);

return $result;
}
$res = process_queue();
touch("myapq.log");

I've added the touch command, just to make sure the page is ran ... and it is !

However, this does not fire the processing of the queue with phpList version 3 ! ! :(

Any idea, what should be done to make it work ?


Cheers,
L@u
ComputingFroggy
phpLister
 
Posts: 12
Joined: 3:12pm, Thu 26 Feb, 2015

Re: Crontab, shared servers and v3

Postby ComputingFroggy » 2:39pm, Fri 06 Mar, 2015

I have also tried firing a page like this :
Code: Select all
#!/usr/local/bin/php
<?php
function pq() {
//variables
$url = 'http://news.mysite.com/admin/?page=processqueue&login=admin&password=mypwd.';
//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
//clean up
curl_close($ch);

return $result;
}

$res = pq();
touch("myapq.log");
?>


when testing the page it's working but with the crontab it's not working ! :(

Any ideas, anyone ?

Cheers,
L@u
ComputingFroggy
phpLister
 
Posts: 12
Joined: 3:12pm, Thu 26 Feb, 2015

Re: Crontab, shared servers and v3

Postby duncanc » 4:14pm, Fri 06 Mar, 2015

The method you are trying to use has changed, see this topic for an example https://forums.phplist.com/viewtopic.php?f=34&t=42068&p=104532&hilit=secret#p104566.

The 'secret' value that you need to use is on the admin Settings page.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Crontab, shared servers and v3

Postby ComputingFroggy » 10:43pm, Fri 06 Mar, 2015

Thanks Duncan, that did the trick ! :D
And I have been looking at this unsuccessfully for 2 days !

I found this doc about the subject:
https://resources.phplist.com/system/remote_processing
There's even a remote service for procession from phpList, I could have used ...

Thanks again for a great product !
ComputingFroggy
phpLister
 
Posts: 12
Joined: 3:12pm, Thu 26 Feb, 2015


Return to Installing and Upgrading

Who is online

Users browsing this forum: No registered users and 1 guest