Answers.Body: <p>Another potential cause is that Civi's WordPress.php file is incorrectly guessing the path to your WP install. You can force the path in your civicrm.settings.php file, like so:</p>
  
  <p><code>define('CIVICRM_CMSDIR','/home/bmeeco/public_html/wordpress');</code></p>
  
  <p>Edit: I think you've actually found a bug (<a href="https://issues.civicrm.org/jira/browse/CRM-14987" rel="nofollow">CRM-14987</a>). The way it guesses the WP path can cause warnings (it's almost guaranteed to if you are on cheap shared hosting). My solution will get you by, however.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T23:01:37.967Z
Answers.Text: Yes! Nicholai - thanks you so much - this resolved the issue for me.
Answers.UserDisplayName: Chris Dubrow
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T23:15:46.497Z
Answers.Text: Glad to hear it! Please consider marking it as the accepted answer for people in the future who are searching on the same problem.
Answers.UserDisplayName: Nicholai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T23:30:33.790Z
Answers.Text: Ahh yes - i see the tick now - done - and thanks again - I am doing the happy chicken dance in your honour
Answers.UserDisplayName: Chris Dubrow
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-10T02:26:15.103Z
Answers.Text: I need to add an aside. There was a requirement for me to create a new version of civicrm on a fresh install of wordpress on the same shared host and mysql db from my original question above. As I was progressing through the installation steps, once I had all the green lights on the civicrm installer screen - the  open_basedir restriction Warning re-appeared. So this was before CiviCRM was fully installed. I was able to proceed successfully through the install, then edited the new civicrm.settings.php  with Nicholai's code (altered to fit new location) and once again this was resolved.
Answers.UserDisplayName: Chris Dubrow
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-10T20:59:20.067Z
Answers.Text: I have CIVICRM_CMSDIR defined, but still get the open_basedir error when trying to generate address labels. Is there another config parameter that is not set in that case?
Answers.UserDisplayName: David Christie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-10T21:01:30.760Z
Answers.Text: I managed to suppress the problem by adding "@" in front of line 96 in file tcpdf_autoconfig.php – 
  
    if (@file_exists($tcpdf_images_path)) { 
  
  – to stop the missing directories from producing error output, and the labels then get produced. This surely cannot be the permanent solution though (it will get overwritten by the next upgrade...)?
  
  I'm on the latest Wordpress version (4.3) and civiCRM (4.6.8)
Answers.UserDisplayName: David Christie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T16:23:24.250Z
Answers.LastActivityDate: 2015-05-29T00:14:21.093Z
Answers.LastEditDate: 2015-05-29T00:14:21.093Z
Answers.UserDisplayName: Nicholai
Body: <p>Issue began with - </p>
  
  <p>Wordpress 4.2.2
  CiviCRM 4.6.2 (later 4.6.3 - see below)
  Php 5.4.33</p>
  
  <p>About 5 days ago on Wordpress installation we were suddenly unable to click into the CiviCRM dashboard via Wordpress backend. The only thing that may have happened that we can see is that a automatic backup may have been attempted but there was not enough server disk space for the back up. The disk has been cleaned out and there is plenty of space now. </p>
  
  <p>When attempting to head to civi - the dashboard icons never stop spinning and there is a Warning at top of page that reads: </p>
  
  <blockquote>
    <p>Warning: file_exists():
    open_basedir restriction in effect.
    File(/home/wp-includes/version.php) is not within the allowed path(s):
    (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)
    in
    /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php
    on line 386</p>
  </blockquote>
  
  <p>With no civicrm menus, I did have partial functionality via URLS of some admin pages such as to Admin / Settings / Upload directories - nothing appears wrong there - but almost nothing works.. </p>
  
  <p>Cron was also spitting me the full warning: </p>
  
  <blockquote>
    <p><b>Warning</b>:  file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in <b>/home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php</b> on line <b>386</b><br /></p>
    
    <p><b>Warning</b>:  session_start(): Cannot send session cookie - headers
    already sent by (output started at
    /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386)
    in
    <b>/home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php</b>
    on line <b>132</b><br /></p>
    
    <p><b>Warning</b>:  session_start(): Cannot send session cache limiter -
    headers already sent (output started at
    /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386)
    in
    <b>/home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php</b>
    on line <b>132</b><br /></p>
    
    <p><b>Warning</b>:  file_exists(): open_basedir restriction in effect.
    File(/home/wp-includes/version.php) is not within the allowed path(s):
    (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)
    in
    <b>/home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php</b>
    on line <b>386</b><br /></p>
  </blockquote>
  
  <p>__ </p>
  
  <p>I note two similar cases - both seem unresolved: 
  <a href="http://forum.civicrm.org/index.php?topic=36378.0" rel="nofollow noreferrer">http://forum.civicrm.org/index.php?topic=36378.0</a>
  where the file is exactly the same - File(/home/wp-includes/version.php)</p>
  
  <p>And there is also the post here: 
  <a href="https://civicrm.stackexchange.com/questions/2210/how-do-i-correct-the-fault-causing-file-exists-open-basedir-restriction-in-e">How do I correct the fault causing &quot;file_exists(): open_basedir restriction in effect&quot;</a>
  - But this is a different file - and there is no response how that went. </p>
  
  <p>SO - I attempted to upgrade to latest CiviCRM 4.6.3
  - There was a warning to update some customised receipt templates, but then the upgrade failed with the warnings: </p>
  
  <blockquote>
    <p>Warning: file_exists(): open_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 394</p>
    
    <p>Warning: Cannot modify header information - headers already sent by
    (output started at
    /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:394)
    in
    /home/bmeeco/public_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php
    on line 413</p>
  </blockquote>
  
  <p>Note the new line numbers.. </p>
  
  <p>I am stuck for ideas - any help greatly appreciated</p>
  
  <p>Chris</p>
  
Tags: <wordpress>
Title: Problem with open_basedir restriction in effect
ThreadText: # Problem with open_basedir restriction in effect
  
  (Asked by: username_0 on 2015-05-27)
  
  Issue began with -
  
  Wordpress 4.2.2
  CiviCRM 4.6.2 (later 4.6.3 - see below)
  Php 5.4.33
  
  About 5 days ago on Wordpress installation we were suddenly unable to click into the CiviCRM dashboard via Wordpress backend. The only thing that may have happened that we can see is that a automatic backup may have been attempted but there was not enough server disk space for the back up. The disk has been cleaned out and there is plenty of space now.
  
  When attempting to head to civi - the dashboard icons never stop spinning and there is a Warning at top of page that reads:
  
  > Warning: file\_exists():
  > open\_basedir restriction in effect.
  > File(/home/wp-includes/version.php) is not within the allowed path(s):
  > (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)
  > in
  > /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php
  > on line 386
  
  With no civicrm menus, I did have partial functionality via URLS of some admin pages such as to Admin / Settings / Upload directories - nothing appears wrong there - but almost nothing works..
  
  Cron was also spitting me the full warning:
  
  > **Warning**: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php** on line **386**
  >
  > **Warning**: session\_start(): Cannot send session cookie - headers
  > already sent by (output started at
  > /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386)
  > in
  > **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php**
  > on line **132**
  >
  > **Warning**: session\_start(): Cannot send session cache limiter -
  > headers already sent (output started at
  > /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386)
  > in
  > **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php**
  > on line **132**
  >
  > **Warning**: file\_exists(): open\_basedir restriction in effect.
  > File(/home/wp-includes/version.php) is not within the allowed path(s):
  > (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)
  > in
  > **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php**
  > on line **386**
  
  \_\_
  
  I note two similar cases - both seem unresolved:
  <http://forum.civicrm.org/index.php?topic=36378.0>
  where the file is exactly the same - File(/home/wp-includes/version.php)
  
  And there is also the post here:
  [How do I correct the fault causing "file\_exists(): open\_basedir restriction in effect"](https://civicrm.stackexchange.com/questions/2210/how-do-i-correct-the-fault-causing-file-exists-open-basedir-restriction-in-e)
  - But this is a different file - and there is no response how that went.
  
  SO - I attempted to upgrade to latest CiviCRM 4.6.3
  - There was a warning to update some customised receipt templates, but then the upgrade failed with the warnings:
  
  > Warning: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 394
  >
  > Warning: Cannot modify header information - headers already sent by
  > (output started at
  > /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:394)
  > in
  > /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php
  > on line 413
  
  Note the new line numbers..
  
  I am stuck for ideas - any help greatly appreciated
  
  Chris
  
  **Tags:** wordpress
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-28. Score: 4 | Accepted answer
  
  Another potential cause is that Civi's WordPress.php file is incorrectly guessing the path to your WP install. You can force the path in your civicrm.settings.php file, like so:
  
  `define('CIVICRM_CMSDIR','/home/bmeeco/public_html/wordpress');`
  
  Edit: I think you've actually found a bug ([CRM-14987](https://issues.civicrm.org/jira/browse/CRM-14987)). The way it guesses the WP path can cause warnings (it's almost guaranteed to if you are on cheap shared hosting). My solution will get you by, however.
  
  > **Comments:**
  > **username_0**: Yes! username_1 - thanks you so much - this resolved the issue for me.  
  > **username_1**: Glad to hear it! Please consider marking it as the accepted answer for people in the future who are searching on the same problem.  
  > **username_0**: Ahh yes - i see the tick now - done - and thanks again - I am doing the happy chicken dance in your honour  
  > **username_0**: I need to add an aside. There was a requirement for me to create a new version of civicrm on a fresh install of wordpress on the same shared host and mysql db from my original question above. As I was progressing through the installation steps, once I had all the green lights on the civicrm installer screen - the  open_basedir restriction Warning re-appeared. So this was before CiviCRM was fully installed. I was able to proceed successfully through the install, then edited the new civicrm.settings.php  with username_1's code (altered to fit new location) and once again this was resolved.  
  > **username_2**: I have CIVICRM_CMSDIR defined, but still get the open_basedir error when trying to generate address labels. Is there another config parameter that is not set in that case?  
  > **username_2**: I managed to suppress the problem by adding "@" in front of line 96 in file tcpdf_autoconfig.php –     if (@file_exists($tcpdf_images_path)) {   – to stop the missing directories from producing error output, and the labels then get produced. This surely cannot be the permanent solution though (it will get overwritten by the next upgrade...)?  I'm on the latest Wordpress version (4.3) and civiCRM (4.6.8)  
  
  ---
  
  