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 »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • civimail cron fails - because of CGI?
Pages: [1]

Author Topic: civimail cron fails - because of CGI?  (Read 1533 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
civimail cron fails - because of CGI?
March 02, 2011, 10:51:01 pm
We have a 3.3.5 site hosted by civihosting on the server which supports ssh.

We have noticed that the CiviMail crons are failing because even though we are running the cron via a URL the script still receives $argv, but the CiviCRM Root is not defined at this point.

Code: [Select]
// 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

I think this must be because the server appears to be running FAST CGI - is there any position on whether CiviCRM is compatible with this?


Code: [Select]
Build Date Jan 27 2011 06:39:07
Configure Command './configure' '--enable-discard-path' '--with-gettext' '--enable-exif' '--enable-bcmath' '--enable-calendar' '--enable-magic-quotes' '--with-curl' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-zlib' '--with-t1lib' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-ttf' '--with-freetype-dir=/usr' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-mhash' '--with-mcrypt' '--with-openssl' '--with-mysql=/usr/local/mysql5' '--with-ldap' '--enable-mbstring' '--enable-inline-optimization' '--with-iconv' '--enable-pcntl' '--with-pspell' '--with-bz2' '--enable-sockets' '--prefix=/usr/local/php5' '--with-xsl' '--with-config-file-path=.:/etc' '--enable-soap' '--with-tidy' '--with-mysqli' '--enable-zip' '--with-pdo-mysql=/usr/local/mysql5' '--enable-fastcgi'
Server API CGI/FastCGI
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: civimail cron fails - because of CGI?
March 02, 2011, 11:24:13 pm
1) Why are you running the inferior web version if you have the superior cli one?

2) Got cgi as well, and argv is not defined.

2) I think I fixed it on EmailProcessor, testing on sapi instead of argv
Could you try if this work for you?

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civimail cron fails - because of CGI?
March 02, 2011, 11:38:24 pm
running the cli is hitting memory issues. I seem to have improved it using -d memory_limit but not enough

So,

if (isset($sapi)) {


?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civimail cron fails - because of CGI?
March 02, 2011, 11:50:14 pm
NB - I had also been wondering if this was because of CGI - well I can't make sense of it.... so I'm blaming it wildly on CGI

http://forum.civicrm.org/index.php/topic,18872.0.html
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: civimail cron fails - because of CGI?
March 03, 2011, 04:34:27 am


Quote from: Eileen on March 02, 2011, 11:38:24 pm
running the cli is hitting memory issues. I seem to have improved it using -d memory_limit but not enough

The php config on debian/ubuntu are different for the cgi/cli/apache

Likely that you updated the memory in one ini and not the other. Feel free to put the memory higher on cli than on cgi/apache: that's only when you run big processes that it runs anyway.

Quote from: Eileen on March 02, 2011, 11:38:24 pm
if (isset($sapi)) {

Exactly. Could you test if it works for you ? Will submit the patch if this is the case.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: civimail cron fails - because of CGI?
March 09, 2011, 02:25:32 pm
Did it work? Can I patch the pgm ?

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civimail cron fails - because of CGI?
March 09, 2011, 02:28:43 pm
I copied this from the other script

if ( php_sapi_name() == "cli" ) {

& it works to the extent that I can send by URL now - I assume that it still works from CLI ....
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • civimail cron fails - because of CGI?

This forum was archived on 2017-11-26.