Answers.Body: <p>After lots of messing around, I upgraded to 4.6.8 and then made a clean copy of the latest civicrm 4.6.8 files into the civicrm/CRM subdirectory, and the cron job ran properly. However, my Wordpress installation failed, because there are multiple Wordpress installations on the server and a search from the top root caused basedir restriction errors (and would probably have failed for that reason...).</p>
  
  <p>The fix was to add the following lines to civicrm.settings.php, just before the section "do not add anything below this":</p>
  
  <p>if (!defined('CIVICRM_CMSDIR')) {
    define( 'CIVICRM_CMSDIR', '/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/' );
  }</p>
  
  <p>It was important to include the "/wordpress/" at the end!</p>
  
  <p>I'm not sure that this overriding parameter is really documented, though. I found it referred to in a forum post.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-29T14:11:04.340Z
Answers.LastActivityDate: 2015-08-29T14:11:04.340Z
Answers.UserDisplayName: David Christie
Body: <p>I'm trying to get the external url-based cron to run and I keep getting fatal errors. I don't really want to debug the PHP code. Can anyone help me?</p>
  
  <p>The URL I use has the correct username, password and sitekey:</p>
  
  <p><a href="http://predigerforum.ch/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=xxx@xxx&amp;pass=xx&amp;key=xxx" rel="nofollow">http://predigerforum.ch/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=xxx@xxx&amp;pass=xx&amp;key=xxx</a></p>
  
  <p>I get the following message:</p>
  
  <p>Fatal error: require_once(): Failed opening required 'CRM/Core/Config.php' (include_path='.') in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php on line 30</p>
  
  <p>It looks like there is a path configuration error, but I cannot find any mistakes in the settings file. I've checked quite a few forum entries and things look correct...</p>
  
  <p>Thanks for any help</p>
  
  <p>David</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T10:16:03.067Z
Comments.Text: I'm using CiviCRM 4.6.4 with the latest Wordpress version
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T10:20:20.723Z
Comments.Text: It looks like the setting of the base path is incorrect. I've just tried the url again and got:
  
  Warning: require_once(): open_basedir restriction in effect. File(/nhldata/wp-includes/pluggable.php) is not within the allowed path(s): (/nhldata/631/106631/data/web:/usr/local/php55/share/pear:/var/tmp/php:/tmp:/usr/local/php55/lib64) in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T10:23:35.683Z
Comments.Text: Warning: require_once(/nhldata/wp-includes/pluggable.php): failed to open stream: Operation not permitted in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T10:24:12.020Z
Comments.Text: Fatal error: require_once(): Failed opening required '/nhldata/wp-includes/pluggable.php' (include_path='.:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/packages:.:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm//packages:.') in
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T10:24:17.657Z
Comments.Text: /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T18:39:10.447Z
Comments.Text: I cleaned up the behaviour by adding 
  
      if (!strpos($dir, '\/wordpress\/')) {   // **DC** 2015.08.27
        return FALSE;                     //    only search within wordpress structure!
      }                                   //
  
  at the start of public function validInstallDir($dir) in WordPress.php, which stopped it complaining about base dir violations (this assumes wordpress in the path, which is true for me). The cron even worked once, but now when I run it I get...
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-27T18:41:56.527Z
Comments.Text: Fatal error: Uncaught exception 'Exception' with message 'Function "is_admin()" is missing, even though WordPress is the user framework.' in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php:255 Stack trace: #0 /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(192): CRM_Utils_System_Base->theme('<div id="crm-co...', false ... /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 255
Comments.UserDisplayName: David Christie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-29T07:18:00.570Z
Comments.Text: I've upgraded successfully to 4.6.8 but still get that exception: "Uncaught exception 'Exception' with message 'Function "is_admin()" is missing, even though WordPress is the user framework.'"
Comments.UserDisplayName: David Christie
Tags: <civimail><cron-job>
Title: Trying to get external cron working
ThreadText: # Trying to get external cron working
  
  (Asked by: username_0 on 2015-08-27)
  
  I'm trying to get the external url-based cron to run and I keep getting fatal errors. I don't really want to debug the PHP code. Can anyone help me?
  
  The URL I use has the correct username, password and sitekey:
  
  <http://predigerforum.ch/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=xxx@xxx&pass=xx&key=xxx>
  
  I get the following message:
  
  Fatal error: require\_once(): Failed opening required 'CRM/Core/Config.php' (include\_path='.') in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php on line 30
  
  It looks like there is a path configuration error, but I cannot find any mistakes in the settings file. I've checked quite a few forum entries and things look correct...
  
  Thanks for any help
  
  David
  
  **Tags:** civimail, cron-job
  
  > **Comments:**
  > **username_0**: I'm using CiviCRM 4.6.4 with the latest Wordpress version  
  > **username_0**: It looks like the setting of the base path is incorrect. I've just tried the url again and got:  Warning: require_once(): open_basedir restriction in effect. File(/nhldata/wp-includes/pluggable.php) is not within the allowed path(s): (/nhldata/631/106631/data/web:/usr/local/php55/share/pear:/var/tmp/php:/tmp:/usr/local/php55/lib64) in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360  
  > **username_0**: Warning: require_once(/nhldata/wp-includes/pluggable.php): failed to open stream: Operation not permitted in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360  
  > **username_0**: Fatal error: require_once(): Failed opening required '/nhldata/wp-includes/pluggable.php' (include_path='.:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/packages:.:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/:/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm//packages:.') in  
  > **username_0**: /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 360  
  > **username_0**: I cleaned up the behaviour by adding       if (!strpos($dir, '\/wordpress\/')) {   // **DC** 2015.08.27       return FALSE;                     //    only search within wordpress structure!     }                                   //  at the start of public function validInstallDir($dir) in WordPress.php, which stopped it complaining about base dir violations (this assumes wordpress in the path, which is true for me). The cron even worked once, but now when I run it I get...  
  > **username_0**: Fatal error: Uncaught exception 'Exception' with message 'Function "is_admin()" is missing, even though WordPress is the user framework.' in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php:255 Stack trace: #0 /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(192): CRM_Utils_System_Base->theme('<div id="crm-co...', false ... /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 255  
  > **username_0**: I've upgraded successfully to 4.6.8 but still get that exception: "Uncaught exception 'Exception' with message 'Function "is_admin()" is missing, even though WordPress is the user framework.'"  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-08-29. Score: 2 | Accepted answer
  
  After lots of messing around, I upgraded to 4.6.8 and then made a clean copy of the latest civicrm 4.6.8 files into the civicrm/CRM subdirectory, and the cron job ran properly. However, my Wordpress installation failed, because there are multiple Wordpress installations on the server and a search from the top root caused basedir restriction errors (and would probably have failed for that reason...).
  
  The fix was to add the following lines to civicrm.settings.php, just before the section "do not add anything below this":
  
  if (!defined('CIVICRM\_CMSDIR')) {
  define( 'CIVICRM\_CMSDIR', '/nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/' );
  }
  
  It was important to include the "/wordpress/" at the end!
  
  I'm not sure that this overriding parameter is really documented, though. I found it referred to in a forum post.
  
  
  ---
  
  