Answers.Body: <p>I don't think the problem is what you think it is (on line 28) because otherwise you should get that same notice (and fatal error) on line 29.</p>
  
  <p>There are a whole bunch of bugs submitted on issues.civicrm.org relating to cron in early versions of 4.1.  Since CiviCRM 4.2 supports Joomla 1.7, my advice is to upgrade to CiviCRM 4.2.20.  Civi 4.2 was a "long term support" release, which means it was getting (some) fixes through April of this year.  It should be in far better shape (especially as regards the cron system) than Civi 4.1.2.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-02T18:46:20.423Z
Answers.Text: Thank you - I'll give that a go next time I'm working on the website
Answers.UserDisplayName: Trevor Wood
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-25T14:43:13.233Z
Answers.Text: Well I'm now at civicrm 4.2.20 and I still get the same error message, but now for line 31
  
  PHP Notice:  Undefined variable: cli in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 31
  PHP Fatal error:  Call to a member function callApi() on a non-object in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 31
  
  Any further ideas?
Answers.UserDisplayName: Trevor Wood
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-25T15:00:28.360Z
Answers.Text: I should add that when I click on "execute now" in the scheduled jobs area of CiviCRM, the emails sends fine.
Answers.UserDisplayName: Trevor Wood
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-01T15:10:49.840Z
Answers.LastActivityDate: 2015-09-01T15:10:49.840Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I've acquired a site that is several generations of CiviCRM out of date - currently running 4.0.7.</p>
  
  <p>I'm working through the upgrades and went to 4.1.0 where the new procedure for sending emails is implemented - unfortunately I can't get it to work</p>
  
  <p>I'm trying to run it manually from the command line at the moment. The command I'm using is</p>
  
  <p>php bin/cli.php -s demo1.network-midlands.co.uk -u ***** -p ***** -e Job -a execute</p>
  
  <p>and every time I run it I get the following error</p>
  
  <pre><code>PHP Notice:  Undefined variable: cli in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 30
  
  PHP Fatal error:  Call to a member function callApi() on a non-object in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 30
  </code></pre>
  
  <p>Lines 28-30 are as follows</p>
  
  <pre><code>$cli = new civicrm_Cli( );
  $cli-&gt;initialize( ) || die(  );
  $cli-&gt;callApi( ) || die(  );
  </code></pre>
  
  <p>it looks like $cli isn't getting defined  on line 28 ($cli = new civicrm_Cli( );)</p>
  
  <p>Any clues?. I've since moved up to CiviCRM 4.1.2 to se eif that fixes it but it doesn't.</p>
  
  <p>Note - Joomla is still at version 1.7 - I'm getting as many of the modules as up to date as possible before moving it all to Joomla 3</p>
  
  <p>Thanks</p>
  
Tags: <civimail><api><joomla><cron>
Title: Error message when trying to run scheduled email send - Joomla
ThreadText: # Error message when trying to run scheduled email send - Joomla
  
  (Asked by: username_0 on 2015-09-01)
  
  I've acquired a site that is several generations of CiviCRM out of date - currently running 4.0.7.
  
  I'm working through the upgrades and went to 4.1.0 where the new procedure for sending emails is implemented - unfortunately I can't get it to work
  
  I'm trying to run it manually from the command line at the moment. The command I'm using is
  
  php bin/cli.php -s demo1.network-midlands.co.uk -u \*\*\*\*\* -p \*\*\*\*\* -e Job -a execute
  
  and every time I run it I get the following error
  
  ```
  PHP Notice:  Undefined variable: cli in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 30
  
  PHP Fatal error:  Call to a member function callApi() on a non-object in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 30
  
  ```
  
  Lines 28-30 are as follows
  
  ```
  $cli = new civicrm_Cli( );
  $cli->initialize( ) || die(  );
  $cli->callApi( ) || die(  );
  
  ```
  
  it looks like $cli isn't getting defined on line 28 ($cli = new civicrm\_Cli( );)
  
  Any clues?. I've since moved up to CiviCRM 4.1.2 to se eif that fixes it but it doesn't.
  
  Note - Joomla is still at version 1.7 - I'm getting as many of the modules as up to date as possible before moving it all to Joomla 3
  
  Thanks
  
  **Tags:** civimail, api, joomla, cron
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-09-01. Score: 1
  
  I don't think the problem is what you think it is (on line 28) because otherwise you should get that same notice (and fatal error) on line 29.
  
  There are a whole bunch of bugs submitted on issues.civicrm.org relating to cron in early versions of 4.1. Since CiviCRM 4.2 supports Joomla 1.7, my advice is to upgrade to CiviCRM 4.2.20. Civi 4.2 was a "long term support" release, which means it was getting (some) fixes through April of this year. It should be in far better shape (especially as regards the cron system) than Civi 4.1.2.
  
  > **Comments:**
  > **username_0**: Thank you - I'll give that a go next time I'm working on the website  
  > **username_0**: Well I'm now at civicrm 4.2.20 and I still get the same error message, but now for line 31  PHP Notice:  Undefined variable: cli in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 31 PHP Fatal error:  Call to a member function callApi() on a non-object in /var/www/vhosts/network-midlands.co.uk/demo1/administrator/components/com_civicrm/civicrm/bin/cli.php on line 31  Any further ideas?  
  > **username_0**: I should add that when I click on "execute now" in the scheduled jobs area of CiviCRM, the emails sends fine.  
  
  ---
  
  