Answers.Body: <p>I would suggest you to not use that folder anymore (Allen is detailing where you can set it), but to write extensions. </p>
  
  <p>What is usually done is to copy paste an existing php file from the core and alter it to fit your need. However, as the original file is likely to be modified in the core between versions, you will either end up with your modify version that has diverged from the core, or you'll need to apply your changes at every upgrade.</p>
  
  <p>Most of what you need to be changed can usually be done more safely and robust from an extension, using hooks</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-08T00:41:58.567Z
Answers.Text: Thanks, Xavier. If that's the case, should the documentation for 4.7 be updated to say this feature is no longer supported?
Answers.UserDisplayName: Ken West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-02T08:14:46.227Z
Answers.LastActivityDate: 2016-02-02T08:14:46.227Z
Answers.UserDisplayName: Xavier
Answers.Body: <p>From the menu: <em>Administer > System Settings > Directories</em></p>
  
  <p>The custom PHP directory is the second option from the bottom.  The help text reads:    </p>
  
  <blockquote>
    <p>Path where site specific PHP code files are stored if any. This
    directory is searched first if set.</p>
  </blockquote>
  
  <p>Note the use of <code>[civicrm.files]</code> at the start of the other directories on that screen if your custom PHP path is going to live within the file structure of your Civi install.</p>
  
  <p><a href="https://i.sstatic.net/N13yf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/N13yf.png" alt="Custom PHP directory"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-04T05:15:51.370Z
Answers.Text: Allen, thanks for the documentation, but I'm reporting a bug. What you're suggesting works in 4.6.3 but 4.7.0. Cheers.
Answers.UserDisplayName: Ken West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-08T00:45:51.113Z
Answers.Text: * not 4.7.0 ...
Answers.UserDisplayName: Ken West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-08T09:54:02.657Z
Answers.Text: I'm probably having the same problem.
  I need to add a report, so, following the documentation, I create all the folders & files structure (php, templates, ...) under my "Custom PHP Directory".
  
  But executing the report I obtain the message *"Fatal error: require_once(): Failed opening required 'CRM\Report\Form\Event\CostSummary.php' (include_path='C:\localhost" ....." and the variable $this->customPHPPathDir is not set.
  
  In the include_path list my "Custom PHP Directory" is not present.
  
  I' need to create an extension also in this situation?
  
  Thanks
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-08T18:14:37.460Z
Answers.Text: @marcello did you include [civicrm.files]/ at the start of your custom PHP directory on the above admin screen?
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-09T12:21:51.313Z
Answers.Text: No I put the full path "C:\localhost\drupal\sites\......\php", also because my report's file are not under "default\files" folder (I'm using drupal).
  Should I move the files under "default\files" folder and use [civicrm.files]/ notation? Thanks
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-09T12:37:48.303Z
Answers.Text: @Allen I did a test after moving the files in a folder under [civicrm.files] and I got the exactly the same message. Behaves as if the "Custom PHP Directory" was not considered in the included path. My Civi version is 4.7.0
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-02T05:17:02.023Z
Answers.LastActivityDate: 2016-02-02T05:17:02.023Z
Answers.UserDisplayName: Allen Hutchison
Body: <p>This appears to be missing. I can't get CiviCRM to execute custom PHP code.</p>
  
  <p>/CRM/Core/Config/Runtime.php at line 139 references $this->customPHPPathDir but there is no such member variable of this object. Because of this customPHPPathDir is not added to the include path.</p>
  
  <p>The comment on the previous line is FIXME.</p>
  
  <p>Is this a bug?</p>
  
Tags: <configuration>
Title: Where is customPHPPathDir set in 4.7.0?
ThreadText: # Where is customPHPPathDir set in 4.7.0?
  
  (Asked by: username_0 on 2016-02-02)
  
  This appears to be missing. I can't get CiviCRM to execute custom PHP code.
  
  /CRM/Core/Config/Runtime.php at line 139 references $this->customPHPPathDir but there is no such member variable of this object. Because of this customPHPPathDir is not added to the include path.
  
  The comment on the previous line is FIXME.
  
  Is this a bug?
  
  **Tags:** configuration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-02-02. Score: 3
  
  I would suggest you to not use that folder anymore (Allen is detailing where you can set it), but to write extensions.
  
  What is usually done is to copy paste an existing php file from the core and alter it to fit your need. However, as the original file is likely to be modified in the core between versions, you will either end up with your modify version that has diverged from the core, or you'll need to apply your changes at every upgrade.
  
  Most of what you need to be changed can usually be done more safely and robust from an extension, using hooks
  
  > **Comments:**
  > **username_0**: Thanks, username_1. If that's the case, should the documentation for 4.7 be updated to say this feature is no longer supported?  
  
  ---
  
  ### Answer by username_2 on 2016-02-02. Score: 2
  
  From the menu: *Administer > System Settings > Directories*
  
  The custom PHP directory is the second option from the bottom. The help text reads:
  
  > Path where site specific PHP code files are stored if any. This
  > directory is searched first if set.
  
  Note the use of `[civicrm.files]` at the start of the other directories on that screen if your custom PHP path is going to live within the file structure of your Civi install.
  
  [![Custom PHP directory](https://i.sstatic.net/N13yf.png)](https://i.sstatic.net/N13yf.png)
  
  > **Comments:**
  > **username_0**: Allen, thanks for the documentation, but I'm reporting a bug. What you're suggesting works in 4.6.3 but 4.7.0. Cheers.  
  > **username_0**: * not 4.7.0 ...  
  > **username_3**: I'm probably having the same problem. I need to add a report, so, following the documentation, I create all the folders & files structure (php, templates, ...) under my "Custom PHP Directory".  But executing the report I obtain the message *"Fatal error: require_once(): Failed opening required 'CRM\Report\Form\Event\CostSummary.php' (include_path='C:\localhost" ....." and the variable $this->customPHPPathDir is not set.  In the include_path list my "Custom PHP Directory" is not present.  I' need to create an extension also in this situation?  Thanks  
  > **username_2**: @username_3 did you include [civicrm.files]/ at the start of your custom PHP directory on the above admin screen?  
  > **username_3**: No I put the full path "C:\localhost\drupal\sites\......\php", also because my report's file are not under "default\files" folder (I'm using drupal). Should I move the files under "default\files" folder and use [civicrm.files]/ notation? Thanks  
  > **username_3**: @Allen I did a test after moving the files in a folder under [civicrm.files] and I got the exactly the same message. Behaves as if the "Custom PHP Directory" was not considered in the included path. My Civi version is 4.7.0  
  
  ---
  
  