CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • file_exists() [function.file-exists]: open_basedir restriction error
Pages: [1]

Author Topic: file_exists() [function.file-exists]: open_basedir restriction error  (Read 5450 times)

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
file_exists() [function.file-exists]: open_basedir restriction error
October 23, 2008, 01:12:48 pm
This is more to help some poor sole in the near future:

On a civiCRM 2.1, Drupal 6.5 (Php 5.2, MYSQL 5.05, apache 2.2) install I was getting the following error when I migrated from dev to staging
(Ubuntu 8.04 laptop MediaTemple CentOS server).  Somehow CiviCRM was trying to access files that were on the dev machine (it was looking for files in the dev machines directory)

file_exists() [function.file-exists]: open_basedir restriction

After a while (clearing caches, resetting civicrm_domain, wiping out templates_c, etc...) I managed to fix it by wiping out the civicrm modules directory, the civicrm.settings.php file and the sites/default/civicrm directory and re-installing civicrm.  Of course I backed up my civicrm database.  Once I re-installed the civicrm database I reset the civicrm_domain table http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=2981949.

It's a painful solution, but easier than hours of banging you head against your desk.  ;)
http://www.rootyhollow.com

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: file_exists() [function.file-exists]: open_basedir restriction error
October 23, 2008, 06:11:24 pm
An obvious question perhaps, but did you check Administer CiviCRM → Global Settings → Directories?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 07, 2008, 02:54:29 pm
sadly I couldn't get to anything in civicrm, it was all a blank screen
http://www.rootyhollow.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 07, 2008, 05:52:41 pm
Brute force resetting the config values in the DB might have worked here. Issue the following SQL command via phpMyAdmin or mysql command line (in your civicrm db):

UPDATE civicrm_domain set config_backend NULL;


Protect your investment in CiviCRM by  becoming a Member!

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 08, 2008, 08:47:58 am
I tried that, definitely not the issue

thought it may have been the system table in Drupal, that also wasn't it.

I'm having the issue again, below is the warning messages from Drupal.    Though the pattern is always the same it's not always the Storage.php file throwing up the error.  This is off of a Druapl 6.6 install, with CiviCRM 2.1.1.  I have reset everything form the civi perspective, i.e. deleted the civicrm folder in sites/all/modules, deleted the sites/default/civicrm.settings.php file.  downloaded a fresh tar ball for civicrm 2.1.1 from Sourceforge

error message:  (my local directory is the /home/www/jdt/ etc... directory)


Code: [Select]
    * warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/jdt/www/providers/sites/all/modules/civicrm/packages/IDS/default_filter.xml) is not within the allowed path(s): (/var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs:/tmp) in /var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs/sites/all/modules/civicrm/packages/IDS/Filter/Storage.php on line 201.
    * warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/jdt/www/providers/sites/all/modules/civicrm/packages/IDS/default_filter.xml) is not within the allowed path(s): (/var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs:/tmp) in /var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs/sites/all/modules/civicrm/packages/IDS/Filter/Storage.php on line 201.
    * warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/jdt/www/providers/sites/all/modules/civicrm/packages/IDS/default_filter.xml) is not within the allowed path(s): (/var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs:/tmp) in /var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs/sites/all/modules/civicrm/packages/IDS/Filter/Storage.php on line 201.
    * warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/jdt/www/providers/sites/all/modules/civicrm/packages/IDS/default_filter.xml) is not within the allowed path(s): (/var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs:/tmp) in /var/www/vhosts/rootyhollow.com/subdomains/providers/httpdocs/sites/all/modules/civicrm/packages/IDS/Filter/Storage.php on line 201.

http://www.rootyhollow.com

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 08, 2008, 11:36:29 am
So this morning I forgot to follow all of my directions from my original post and didn't delete the files/civicrm directory before I re-installed.   This allowed me to narrow down the culprit to that directory.  Turns out it's /sites/default/files/civicrm/upload/Config.IDS.ini.  It's obvious once you open the file but it's the filter_path, temp_path & HTML_Purifier_path variables.

Call me crazy but why would these paths be set in a file and not in the civicrm_domain table?
http://www.rootyhollow.com

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 08, 2008, 12:45:25 pm
Quote
Turns out it's /sites/default/files/civicrm/upload/Config.IDS.ini.  It's obvious once you open the file but it's the filter_path, temp_path & HTML_Purifier_path variables.
Call me crazy but why would these paths be set in a file and not in the civicrm_domain table?

"Config.IDS.ini" is an auto generated file and those urls are calculated based on config vars (i.e civicrm_domain table). Check CRM/Core/IDS.php for more details.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 09, 2008, 07:07:52 am
That makes sense but it's clearly not updated when you clear out the civicrm_domain table after the initial set-up.  I dropped the entire database and re-installed, after resetting civicrm_domain no less than 5 times.  I would suggest it's a permission issue but it's a CiviCRM created file under in the sites/default/files directory which civi had write permission to other wise I would have had tons of other issues.

Does this mean with 2.1 we are supposed to wipe the entire files directory when we move form one server to another?
http://www.rootyhollow.com

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: file_exists() [function.file-exists]: open_basedir restriction error
November 09, 2008, 08:16:16 am
Quote from: jalama on November 09, 2008, 07:07:52 am
Does this mean with 2.1 we are supposed to wipe the entire files directory when we move form one server to another?

yes, we do recommend folks wipe their templates_c directory on an upgrade. wiping the upload directory on server moves and periodically is also a good idea

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • file_exists() [function.file-exists]: open_basedir restriction error

This forum was archived on 2017-11-26.