CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Problems with CiviMail Cron job PHP Shell version
Pages: [1]

Author Topic: Problems with CiviMail Cron job PHP Shell version  (Read 1808 times)

jamida

  • Guest
Problems with CiviMail Cron job PHP Shell version
July 07, 2010, 06:16:45 pm
the CLI version of PHP is available on my system, but I think the manual is wrong.

I've tried to run the suggested cron job from the command line but get the following results:

$ php EmailProcessor.php -uusername -ppassword
ERROR: You need to send a valid user name and password to execute this file

I've tried lots of variations, no luck:
$ php EmailProcessor.php --user=username --pass=password
$ php EmailProcessor.php --name=username --pass=password
$ php EmailProcessor.php -nusername -ppassword

all the same result. BTW, this same username,password combo works just fine this way:
http://mysite.com/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php?name=username&pass=password&key=civicrmkey

I'll try the wget version, but I'd rather use the shell version. Am I doing something wrong and/or are the instructions incorrect?

Thanks

Mike



xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problems with CiviMail Cron job PHP Shell version
July 07, 2010, 09:49:37 pm
Hi,
Are you configured in a drupal multisite ?

bin/EmailProcessor.php -smysite.com -uuser -ppassword

Another difference: it runs from the root of your civicrm, you seems to run it from within the bin directory.

Let us know if it works

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

jamida

  • Guest
Re: Problems with CiviMail Cron job PHP Shell version
July 07, 2010, 10:44:55 pm

I'm running it under Joomla! and I tried the -s switch... same error message.

Regarding the bin directory... recall for testing/debugging this I'm actually kicking if off in the shell myself and not from within a cron job, so I've previously cd'd into the bin directory.

I've thought that perhaps the key that's used in the wget version could be it, but I've tried that too. It's frustrating because this is so clearly described in the documentation yet this aspect seems completely broken or poorly documented. It's odd.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problems with CiviMail Cron job PHP Shell version
July 07, 2010, 11:22:08 pm
Argl, then something is probably behaving differently on Joomla than on Drupal.

Don't have a running joomla to be able to test, could you help debugging the problem ?

----- debug mode starting--- ;)

The error msg comes from CRM/Utils/System.php
in authenticateScript() the name is empty

What's your civicrm version ?

you have one file cli.php in tools/bin/scripts/cli.php ?

If contains a line :
$this->authenticate($user,$pass);

could you add die ("user:$user & pass:$pass") before it ?

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

jamida

  • Guest
Re: Problems with CiviMail Cron job PHP Shell version
July 08, 2010, 08:48:34 am

CiviCRM version 3.1.5

I found CRM/Utils/System.php and found the definition of authenticateScript there.

Unfortunately I do not appear to have a cli.php anywhere in my webfolder (find . -name cli.php -print turned up nothing)
furthermore no tools/bin/scripts folder either (actually no tools folder anywhere on the webfolder and a folder called scripts only exists in the civicrm/packages/DB folder)

Note, btw, I'll be  happy to do a few more debug cycles with you, but I also have it working with the wget version. :-/

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problems with CiviMail Cron job PHP Shell version
July 08, 2010, 10:05:49 am
Hi,

You don't have the cli.php and it doesn't scream ?

Argl (seeing the light): sorry, the cli version was reshuffled between the last version of 3.1 and 3.2. In 3.2 it works directly, in 3.1, you have to add two things:

At the bottom of bin/civimail.cronjob.php
remove run( );
and put
// you can run this program either from an apache command, or from the cli
if (isset($argv)) {
  require_once ("bin/cli.php");
  $cli=new civicrm_cli ();
  //if it doesn't die, it's authenticated
  processQueue( );
} else  { //from the webserver
  run( );
}
 

and download this file and put it in bin:

http://svn.civicrm.org/civicrm/trunk/bin/cli.php

As you said, works with wget, but if you're willing to change these two things, would confirm it works on joomla.

X+

P.S. The book is describing the 3.2 version, that's why you had that differences between your install and the doc.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

jamida

  • Guest
Re: Problems with CiviMail Cron job PHP Shell version
July 08, 2010, 10:14:03 am

Thanks for the help!

I'm sure I may run into other 3.1 vs 3.2 differences. And I think I''ll wait for 3.2 to go into the stable release mode to solve this issue. I'll just continue to use wget until then.

Any idea when 3.2 will be in the "stable" state? And/or how involved the upgrade will be? I don't expect an answer here, a link will do.

Thanks again.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Problems with CiviMail Cron job PHP Shell version
July 09, 2010, 04:37:00 am
Quote from: jamida on July 08, 2010, 10:14:03 am
Any idea when 3.2 will be in the "stable" state?

Hopefully next week; sometime this month at the latest.

Quote
And/or how involved the upgrade will be?

Upgrades are usually not-that-troublesome (basically: download files, run upgrade script); we highly encourage to do them on a copy of your website, and if you do, you can as well upgrade it to 3.2.beta3 (released two days ago) and see how it goes. :)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

dragontree

  • Guest
Re: Problems with CiviMail Cron job PHP Shell version
July 20, 2010, 10:36:38 pm
I can confirm that the above instructions work on Joomla 1.5.17 (Civicrm 3.1.4)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Problems with CiviMail Cron job PHP Shell version

This forum was archived on 2017-11-26.