Answers.Body: <p>Welcome to SE.  If you can, I suggest using the <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv" rel="nofollow noreferrer">cv</a> cron method - might be easier than debugging what's happening there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-21T00:58:07.203Z
Answers.Text: Loaded cv.phar.  took some fiddling to get the paths right, and had to change php.ini to allow_url_fopen to "true"...   once that was done Cron Jobs started executing as expected.
Answers.UserDisplayName: Phil Catlin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-20T11:16:03.780Z
Answers.LastActivityDate: 2024-05-21T09:48:21.907Z
Answers.LastEditDate: 2024-05-21T09:48:21.907Z
Answers.UserDisplayName: Aidan
Body: <p>I'm trying to configure a valid call to cron</p>
  <p>I'm using the following command in cron:
  /usr/local/bin/ea-php81  /[root path]/administrator/components/com_civicrm/civicrm/bin/cli.php-s mysite.org -u username -p password -e Job -a execute</p>
  <p>When I run this from a terminal window, I get the following error message:
  Symfony\Component\ErrorHandler\Error\UndefinedMethodError^ {#1813
  #message: &quot;Attempted to call an undefined method named &quot;login&quot; of class &quot;Joomla\CMS\Application\ConsoleApplication&quot;.&quot;
  #code: 0
  #file: &quot;./[path]/administrator/components/com_civicrm/civicrm/CRM/Utils/System/Joomla.php&quot;
  #line: 481
  trace: {
  ./[path]/administrator/components/com_civicrm/civicrm/CRM/Utils/System/Joomla.php:481 {
  CRM_Utils_System_Joomla-&gt;loadUser($username, $password = null)^
  › //perform the login action
  ›   $instance-&gt;login($params);
  ›
  }
  ./[path]/administrator/components/com_civicrm/civicrm/bin/cli.class.php:269 { …}
  ./[path]/administrator/components/com_civicrm/civicrm/bin/cli.class.php:67 { …}
  ./[path]/administrator/components/com_civicrm/civicrm/bin/cli.php:16 { …}
  }
  }</p>
  <p>any guidance would be greatly appreciated.</p>
  <p>Version info:
  pHp version 8.1. (the &quot;/usr/local/bin/ea-php81&quot; is from the web host's documentation)
  Joomla version: 4.4.0
  CiviCRM version: 5.67.1</p>
  <p>Thanks!
  --Phil</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-25T12:38:49.277Z
Comments.Text: The background story here is that J4 further separated the Joomla CMS and the Joomla Framework. This changed a lot of things when it comes to CLI applications. I had a first look at the CiviCRM Joomla adapter and it seems that to make it work it has to change radically.
Comments.UserDisplayName: thoni56
Tags: <joomla><cron>
Title: Trying to get Cron Jobs to run with joomla inCPanel
ThreadText: # Trying to get Cron Jobs to run with joomla inCPanel
  
  (Asked by: username_0 on 2024-05-19)
  
  I'm trying to configure a valid call to cron
  
  I'm using the following command in cron:
  /usr/local/bin/ea-php81 /[root path]/administrator/components/com\_civicrm/civicrm/bin/cli.php-s mysite.org -u username -p password -e Job -a execute
  
  When I run this from a terminal window, I get the following error message:
  Symfony\Component\ErrorHandler\Error\UndefinedMethodError^ {#1813
  #message: "Attempted to call an undefined method named "login" of class "Joomla\CMS\Application\ConsoleApplication"."
  #code: 0
  #file: "./[path]/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php"
  #line: 481
  trace: {
  ./[path]/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php:481 {
  CRM\_Utils\_System\_Joomla->loadUser($username, $password = null)^
  › //perform the login action
  › $instance->login($params);
  ›
  }
  ./[path]/administrator/components/com\_civicrm/civicrm/bin/cli.class.php:269 { …}
  ./[path]/administrator/components/com\_civicrm/civicrm/bin/cli.class.php:67 { …}
  ./[path]/administrator/components/com\_civicrm/civicrm/bin/cli.php:16 { …}
  }
  }
  
  any guidance would be greatly appreciated.
  
  Version info:
  pHp version 8.1. (the "/usr/local/bin/ea-php81" is from the web host's documentation)
  Joomla version: 4.4.0
  CiviCRM version: 5.67.1
  
  Thanks!
  --Phil
  
  **Tags:** joomla, cron
  
  > **Comments:**
  > **username_1**: The background story here is that J4 further separated the Joomla CMS and the Joomla Framework. This changed a lot of things when it comes to CLI applications. I had a first look at the CiviCRM Joomla adapter and it seems that to make it work it has to change radically.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-05-20. Score: 0 | Accepted answer
  
  Welcome to SE. If you can, I suggest using the [cv](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv) cron method - might be easier than debugging what's happening there.
  
  > **Comments:**
  > **username_0**: Loaded cv.phar.  took some fiddling to get the paths right, and had to change php.ini to allow_url_fopen to "true"...   once that was done Cron Jobs started executing as expected.  
  
  ---
  
  