Answers.Body: <p><code>open_basedir</code> is a PHP setting that limits which files can be accessed by PHP for processing.  Its default value invariably is not set to work with CiviCRM and the general recommendation is to disable it.</p>
  
  <p>To disable it, in the httpd.conf file add a php directive: <code>php_admin_value open_basedir none</code>. </p>
  
  <p>More details can be found here: <a href="http://php.net/manual/en/ini.core.php#ini.open-basedir" rel="nofollow">http://php.net/manual/en/ini.core.php#ini.open-basedir</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-05T18:05:18.043Z
Answers.LastActivityDate: 2016-07-05T18:05:18.043Z
Answers.UserDisplayName: DaveD
Answers.Body: <p>I found my own preferred solution. </p>
  
  <p>The default <em>include_path</em>, when not set elsewhere, is in my case <em>.:/usr/share/php:/usr/share/pear</em> It is determined at compile time. It can be overridden everywhere also in the script civicrm.settings.php where it is changed for CiviCRM's purposes: </p>
  
  <pre><code>$include_path = '.'           . PATH_SEPARATOR .
                  $civicrm_root . PATH_SEPARATOR .
                  $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
                  get_include_path( );
  </code></pre>
  
  <p>As you can see the compiler default is appended. </p>
  
  <p>Knowing where it is set. We also can find the best solution. </p>
  
  <p>In my case I can simply insert this: </p>
  
  <pre><code>set_include_path('.'.PATH_SEPARATOR.DIRECTORY_SEPARATOR.'usr'.DIRECTORY_SEPARATOR.'share'.DIRECTORY_SEPARATOR.'php');
  </code></pre>
  
  <p>in civicrm.settings.php somewhere before the previously quoted code. That will remove path that does not exist and does not appear in open_basedir. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-06T15:25:14.587Z
Answers.LastActivityDate: 2016-07-06T15:25:14.587Z
Answers.UserDisplayName: ñull
Answers.Body: <p>Sounds like it's guessing the path; Have you tried explicitly adding paths to your civicrm.settings.php</p>
  
  <p>For your CMS path: define
  CIVICRM_CMSDIR</p>
  
  <p>and double check the:
  CiviCRM_UF_BASEURL</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-05T12:54:56.167Z
Answers.LastActivityDate: 2016-07-05T12:54:56.167Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>I try to get rid of this persistent and annoying warning message: </p>
  
  <blockquote>
    <p>Warning: is_dir(): open_basedir restriction in effect.
    File(/usr/share/pear/api/v3) is not within the allowed path(s):
    (/var/www/civicrm/htdocs:/var/www/civicrm/apps:/var/www/civicrm/priv:/var/www/civicrm/tmp:/usr/share/php:/tmp)
    in Civi\API\Provider\MagicFunctionProvider->getEntityNames() (line 106
    of
    /var/www/civicrm/htdocs/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php).</p>
  </blockquote>
  
  <p>getEntityNames gets the /usr/share/pear path from the get_include_path(). Where is the /usr/share/pear coming from? The path does not even exist on my Ubuntu 14.04 system.  I have been looking everywhere. CiviCRM runs under Drupal, Apache and PHP fastcgi.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-21T10:27:43.487Z
Comments.Text: I see three answers here but not anyone conclusive. So what is the best answer?
Comments.UserDisplayName: ñull
Tags: <error><php><configuration>
Title: Where is include_path set?
ThreadText: # Where is include_path set?
  
  (Asked by: username_0 on 2016-07-04)
  
  I try to get rid of this persistent and annoying warning message:
  
  > Warning: is\_dir(): open\_basedir restriction in effect.
  > File(/usr/share/pear/api/v3) is not within the allowed path(s):
  > (/var/www/civicrm/htdocs:/var/www/civicrm/apps:/var/www/civicrm/priv:/var/www/civicrm/tmp:/usr/share/php:/tmp)
  > in Civi\API\Provider\MagicFunctionProvider->getEntityNames() (line 106
  > of
  > /var/www/civicrm/htdocs/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php).
  
  getEntityNames gets the /usr/share/pear path from the get\_include\_path(). Where is the /usr/share/pear coming from? The path does not even exist on my Ubuntu 14.04 system. I have been looking everywhere. CiviCRM runs under Drupal, Apache and PHP fastcgi.
  
  **Tags:** error, php, configuration
  
  > **Comments:**
  > **username_0**: I see three answers here but not anyone conclusive. So what is the best answer?  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-07-05. Score: 1
  
  `open_basedir` is a PHP setting that limits which files can be accessed by PHP for processing. Its default value invariably is not set to work with CiviCRM and the general recommendation is to disable it.
  
  To disable it, in the httpd.conf file add a php directive: `php_admin_value open_basedir none`.
  
  More details can be found here: <http://php.net/manual/en/ini.core.php#ini.open-basedir>
  
  
  ---
  
  ### Answer by username_0 on 2016-07-06. Score: 1
  
  I found my own preferred solution.
  
  The default *include\_path*, when not set elsewhere, is in my case *.:/usr/share/php:/usr/share/pear* It is determined at compile time. It can be overridden everywhere also in the script civicrm.settings.php where it is changed for CiviCRM's purposes:
  
  ```
  $include_path = '.'           . PATH_SEPARATOR .
                  $civicrm_root . PATH_SEPARATOR .
                  $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
                  get_include_path( );
  
  ```
  
  As you can see the compiler default is appended.
  
  Knowing where it is set. We also can find the best solution.
  
  In my case I can simply insert this:
  
  ```
  set_include_path('.'.PATH_SEPARATOR.DIRECTORY_SEPARATOR.'usr'.DIRECTORY_SEPARATOR.'share'.DIRECTORY_SEPARATOR.'php');
  
  ```
  
  in civicrm.settings.php somewhere before the previously quoted code. That will remove path that does not exist and does not appear in open\_basedir.
  
  
  ---
  
  ### Answer by username_2 on 2016-07-05. Score: 0
  
  Sounds like it's guessing the path; Have you tried explicitly adding paths to your civicrm.settings.php
  
  For your CMS path: define
  CIVICRM\_CMSDIR
  
  and double check the:
  CiviCRM\_UF\_BASEURL
  
  
  ---
  
  