Body: <p>I'm getting 500 errors running something like this:</p>
  
  <p><a href="http://www.mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&amp;pass=mypass&amp;key=mykey" rel="nofollow noreferrer">http://www.mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&amp;pass=mypass&amp;key=mykey</a></p>
  
  <p>This is an example of the error, which the web host tech support sent to me:</p>
  
  <pre><code>207.118.16.184 - - [11/Jun/2017:12:44:03 -0700] "GET /wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&amp;pass=mypass&amp;key=mykey HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
  </code></pre>
  
  <p>When I run the command in cpanel cron (using <code>wget -O -q -t 1</code>), the email that the Cron Daemon sends me looks like this:</p>
  
  <pre><code>--2017-06-11 14:05:01--  http://www.mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser
  Resolving www.mysite.com (www.mysite.com)... 12.345.678.9
  Connecting to www.mysite.com (www.mysite.com)|12.345.678.9|:80... connected.
  HTTP request sent, awaiting response... 500 Internal Server Error
  2017-06-11 14:05:01 ERROR 500: Internal Server Error.
  </code></pre>
  
  <p>It looked to me like, in <code>cron.php</code>, the last three of the four requires shown below were wrong and needed an additional <code>../</code> to find the files. So I edited cron.php to change that, but continued to get 500 errors.</p>
  
  <p>require_once '../civicrm.config.php';</p>
  
  <p>require_once 'CRM/Core/Config.php'; --> changed to '../CRM/Core/Config.php'</p>
  
  <p>require_once 'CRM/Utils/Request.php'; --> changed to '../CRM/Utils/Request.php'</p>
  
  <p>require_once 'CRM/Core/JobManager.php';--> changed to '../CRM/Utils/Request.php'</p>
  
  <p>So I created a test file, <code>cron_requires.php</code>, shown below. The hello prints out, the file_exists() statements find the files, but I'm still getting 500 errors:</p>
  
  <pre><code>&lt;?php
  echo nl2br ("hello\n\n");
  $filename1 = '../civicrm.config.php';
  $filename2 = '../CRM/Core/Config.php';
  $filename3 = '../CRM/Utils/Request.php';
  $filename4 = '../CRM/Core/JobManager.php';
  
  if (file_exists($filename1)) {
      echo nl2br ("The file $filename1 exists\n");
  } else {
      echo nl2br ("The file $filename1 does not exist\n");
  }
  if (file_exists($filename2)) {
      echo nl2br ("The file $filename2 exists\n");
  } else {
      echo nl2br ("The file $filename2 does not exist\n");
  }
  if (file_exists($filename3)) {
      echo nl2br ("The file $filename3 exists\n");
  } else {
      echo nl2br ("The file $filename3 does not exist\n");
  }
  if (file_exists($filename4)) {
      echo nl2br ("The file $filename4 exists\n");
  } else {
      echo nl2br ("The file $filename4 does not exist\n");
  }
  require_once '../civicrm.config.php';
  require_once '../CRM/Core/Config.php';
  require_once '../CRM/Utils/Request.php';
  require_once '../CRM/Core/JobManager.php';
  ?&gt;
  </code></pre>
  
  <p>===== added June 12 ======</p>
  
  <p>Following advice to enable PHP errors, it seems perhaps CiviCRM is failing  to locate civicrm.settings.php on boot.</p>
  
  <p>Specifically, the <code>error_log</code> in /plugins/civicrm/civicrm/bin/ has this:</p>
  
  <pre><code>[12-Jun-2017 20:15:37 America/Denver] PHP Fatal error:  Uncaught Exception: Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure. in /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php:125
  Stack trace:
  #0 /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php(415): Civi\Cv\Bootstrap-&gt;boot()
  #1 /path/to/mysite/wp-content/plugins/civicrm/civicrm/bin/cron.php(29): require_once('/path/to/...')
  #2 {main}
    thrown in /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 125
  </code></pre>
  
  <p>Line 125 of civicrm.config.php is the <code>throw</code> statement here:</p>
  
  <pre><code>/**
     * Bootstrap the CiviCRM runtime.
     *
     * @param array $options
     *   See options in class doc.
     * @throws \Exception
     */
    public function boot($options = array()) {
      if (!defined('CIVICRM_SETTINGS_PATH')) {
        $this-&gt;options = $options = array_merge($this-&gt;options, $options);
  
        $settings = $this-&gt;getCivicrmSettingsPhp($options);
        if (empty($settings) || !file_exists($settings)) {
          throw new \Exception("Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.");
        }
  </code></pre>
  
  <p>I am finding civicrm.settings.php in wp-content/uploads/civicrm/</p>
  
  <p>Not sure how to proceed. Thanks in advance for any help!</p>
  
  <p>WordPress 4.8  CiviCRM 4.7.17</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-11T22:13:10.953Z
Comments.Text: You need to see what's going wrong to resolve this. I recommend you make sure you can view PHP errors (see [this answer](https://civicrm.stackexchange.com/questions/6399/how-do-i-debug-civicrm-when-i-hit-a-blank-page-white-screen-fatal-error) for pointers). Either find your PHP error log and watch it while triggering the error, or set `display_errors` to `true` to see errors in the browser. From there, next steps will probably be much clearer.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-13T04:09:03.840Z
Comments.Text: Thank you @ChrisBurgess. I added some PHP error info at the end of my question. Perhaps this will give a clue to what's wrong?
Comments.UserDisplayName: user1147171
Tags: <wordpress><cron><500>
Title: Server error 500 running cron.php in wp-content/plugins/civicrm/civicrm/bin/
ThreadText: # Server error 500 running cron.php in wp-content/plugins/civicrm/civicrm/bin/
  
  (Asked by: username_0 on 2017-06-11)
  
  I'm getting 500 errors running something like this:
  
  <http://www.mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&pass=mypass&key=mykey>
  
  This is an example of the error, which the web host tech support sent to me:
  
  ```
  207.118.16.184 - - [11/Jun/2017:12:44:03 -0700] "GET /wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&pass=mypass&key=mykey HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
  
  ```
  
  When I run the command in cpanel cron (using `wget -O -q -t 1`), the email that the Cron Daemon sends me looks like this:
  
  ```
  --2017-06-11 14:05:01--  http://www.mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser
  Resolving www.mysite.com (www.mysite.com)... 12.345.678.9
  Connecting to www.mysite.com (www.mysite.com)|12.345.678.9|:80... connected.
  HTTP request sent, awaiting response... 500 Internal Server Error
  2017-06-11 14:05:01 ERROR 500: Internal Server Error.
  
  ```
  
  It looked to me like, in `cron.php`, the last three of the four requires shown below were wrong and needed an additional `../` to find the files. So I edited cron.php to change that, but continued to get 500 errors.
  
  require\_once '../civicrm.config.php';
  
  require\_once 'CRM/Core/Config.php'; --> changed to '../CRM/Core/Config.php'
  
  require\_once 'CRM/Utils/Request.php'; --> changed to '../CRM/Utils/Request.php'
  
  require\_once 'CRM/Core/JobManager.php';--> changed to '../CRM/Utils/Request.php'
  
  So I created a test file, `cron_requires.php`, shown below. The hello prints out, the file\_exists() statements find the files, but I'm still getting 500 errors:
  
  ```
  <?php
  echo nl2br ("hello\n\n");
  $filename1 = '../civicrm.config.php';
  $filename2 = '../CRM/Core/Config.php';
  $filename3 = '../CRM/Utils/Request.php';
  $filename4 = '../CRM/Core/JobManager.php';
  
  if (file_exists($filename1)) {
      echo nl2br ("The file $filename1 exists\n");
  } else {
      echo nl2br ("The file $filename1 does not exist\n");
  }
  if (file_exists($filename2)) {
      echo nl2br ("The file $filename2 exists\n");
  } else {
      echo nl2br ("The file $filename2 does not exist\n");
  }
  if (file_exists($filename3)) {
      echo nl2br ("The file $filename3 exists\n");
  } else {
      echo nl2br ("The file $filename3 does not exist\n");
  }
  if (file_exists($filename4)) {
      echo nl2br ("The file $filename4 exists\n");
  } else {
      echo nl2br ("The file $filename4 does not exist\n");
  }
  require_once '../civicrm.config.php';
  require_once '../CRM/Core/Config.php';
  require_once '../CRM/Utils/Request.php';
  require_once '../CRM/Core/JobManager.php';
  ?>
  
  ```
  
  ===== added June 12 ======
  
  Following advice to enable PHP errors, it seems perhaps CiviCRM is failing to locate civicrm.settings.php on boot.
  
  Specifically, the `error_log` in /plugins/civicrm/civicrm/bin/ has this:
  
  ```
  [12-Jun-2017 20:15:37 America/Denver] PHP Fatal error:  Uncaught Exception: Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure. in /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php:125
  Stack trace:
  #0 /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php(415): Civi\Cv\Bootstrap->boot()
  #1 /path/to/mysite/wp-content/plugins/civicrm/civicrm/bin/cron.php(29): require_once('/path/to/...')
  #2 {main}
    thrown in /path/to/mysite/wp-content/plugins/civicrm/civicrm/civicrm.config.php on line 125
  
  ```
  
  Line 125 of civicrm.config.php is the `throw` statement here:
  
  ```
  /**
     * Bootstrap the CiviCRM runtime.
     *
     * @param array $options
     *   See options in class doc.
     * @throws \Exception
     */
    public function boot($options = array()) {
      if (!defined('CIVICRM_SETTINGS_PATH')) {
        $this->options = $options = array_merge($this->options, $options);
  
        $settings = $this->getCivicrmSettingsPhp($options);
        if (empty($settings) || !file_exists($settings)) {
          throw new \Exception("Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure.");
        }
  
  ```
  
  I am finding civicrm.settings.php in wp-content/uploads/civicrm/
  
  Not sure how to proceed. Thanks in advance for any help!
  
  WordPress 4.8 CiviCRM 4.7.17
  
  **Tags:** wordpress, cron, 500
  
  > **Comments:**
  > **username_1**: You need to see what's going wrong to resolve this. I recommend you make sure you can view PHP errors (see [this answer](https://civicrm.stackexchange.com/questions/6399/how-do-i-debug-civicrm-when-i-hit-a-blank-page-white-screen-fatal-error) for pointers). Either find your PHP error log and watch it while triggering the error, or set `display_errors` to `true` to see errors in the browser. From there, next steps will probably be much clearer.  
  > **username_0**: Thank you @username_1. I added some PHP error info at the end of my question. Perhaps this will give a clue to what's wrong?  
  
  ---
  
  ## 0 answers
  
  