Answers.Body: <p>One thought is that the you are not running the cli version of php on the command line.  Different hosts have different settings, and I don't know IONOS.</p>
  <p>I use the following to be sure I get the php cli version I need:</p>
  <pre><code>/usr/bin/php8.1 /usr/local/bin/wp --user=civicron --url=https://example.corg --path=/home/example/public_html --timezone=America/New_York cv api job.execute auth=0
  </code></pre>
  <p>I can usually find if the cli version by trying at the command line:</p>
  <pre><code>which php
  </code></pre>
  <p>and</p>
  <pre><code>wp --info
  </code></pre>
  <p>The latter command should show the same version of php in the <code>which php</code> command and will have a section like this:</p>
  <pre><code>PHP binary: /usr/bin/php8.1
  PHP version:    8.1.23
  php.ini used:   /etc/php/8.1/cli/php.ini
  </code></pre>
  <p>On my system I can clearly see from the ini file that it's the CLI version.</p>
  <p>on a cPanel server I get:</p>
  <pre><code>PHP binary: /opt/cpanel/ea-php81/root/usr/bin/php
  PHP version:    8.1.22
  php.ini used:   /opt/cpanel/ea-php81/root/etc/php.ini
  </code></pre>
  <p>Often cron will not respect the path which is why I tend to explicitly call the script with <code>/usr/bin/php /usr/local/bin/wp</code>  as opposed to just <code>wp</code>.</p>
  <p>If you have any doubts, ask IONOS for the full path to the command line version of php.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-12T11:29:40.027Z
Answers.LastActivityDate: 2023-09-12T11:29:40.027Z
Answers.UserDisplayName: Kevin Cristiano
Body: <p>Hi I was following this guide <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#commands" rel="nofollow noreferrer">CiviCRM Page</a> to try and get the mail scheduler to work for CiviMail. I tried doing HTTP Request and WP-CLI methods, but both had issues.</p>
  <p>For WP-CLI, I used:
  wp --user=username --url=https://URL --path=/homepages/.../htdocs/wordpress civicrm api job.execute auth=0
  This just hung and didn't do anything.</p>
  <p>For HTTP: I used:
  wget -O - -q -t 1 'https://url/wp-content/plugins/civicrm/civicrm/bin/cron.php
  ?name=username&amp;pass=password&amp;key=key'.
  This didn't hang, but also didn't return or do anything. When I tried to put the url in the browser, it returned and Error 500 after a lot of time trying to load.</p>
  <p>I am using IONOS as my hosting for Wordpress and am using CiviCRM 5.65.1.</p>
  <p>Any help would be appreciated. Thank you!</p>
  
Tags: <wordpress><civimail>
Title: Can't get cron.php to run using the commands
ThreadText: # Can't get cron.php to run using the commands
  
  (Asked by: username_0 on 2023-09-12)
  
  Hi I was following this guide [CiviCRM Page](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#commands) to try and get the mail scheduler to work for CiviMail. I tried doing HTTP Request and WP-CLI methods, but both had issues.
  
  For WP-CLI, I used:
  wp --user=username --url=https://URL --path=/homepages/.../htdocs/wordpress civicrm api job.execute auth=0
  This just hung and didn't do anything.
  
  For HTTP: I used:
  wget -O - -q -t 1 'https://url/wp-content/plugins/civicrm/civicrm/bin/cron.php
  ?name=username&pass=password&key=key'.
  This didn't hang, but also didn't return or do anything. When I tried to put the url in the browser, it returned and Error 500 after a lot of time trying to load.
  
  I am using IONOS as my hosting for Wordpress and am using CiviCRM 5.65.1.
  
  Any help would be appreciated. Thank you!
  
  **Tags:** wordpress, civimail
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-09-12. Score: 2
  
  One thought is that the you are not running the cli version of php on the command line.  Different hosts have different settings, and I don't know IONOS.
  I use the following to be sure I get the php cli version I need:
  /usr/bin/php8.1 /usr/local/bin/wp --user=civicron --url=https://example.corg --path=/home/example/public_html --timezone=America/New_York cv api job.execute auth=0
  
  I can usually find if the cli version by trying at the command line:
  which php
  
  and
  wp --info
  
  The latter command should show the same version of php in the which php command and will have a section like this:
  PHP binary: /usr/bin/php8.1
  PHP version:    8.1.23
  php.ini used:   /etc/php/8.1/cli/php.ini
  
  On my system I can clearly see from the ini file that it's the CLI version.
  on a cPanel server I get:
  PHP binary: /opt/cpanel/ea-php81/root/usr/bin/php
  PHP version:    8.1.22
  php.ini used:   /opt/cpanel/ea-php81/root/etc/php.ini
  
  Often cron will not respect the path which is why I tend to explicitly call the script with /usr/bin/php /usr/local/bin/wp  as opposed to just wp.
  If you have any doubts, ask IONOS for the full path to the command line version of php.
  
  
  ---
  
  