Warning: file_exists(): open_basedir restriction in effect.

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 5, 2018   (RSS)

By Deborah - April 3, 2018

Bumping this to the top... :)

By Dave - April 4, 2018

Hi Deborah, 

That section is mostly just debugging information, letting you know which config files are being used, so that error can safely be ignored.  We're double checking if config files exist, but the open_basedir restriction can prevent us from doing that.  Here's a patch to hide the error:

Replace this

foreach ($configFiles as $configFile => $isLoaded) {
  $filePath = absPath($configFile, SCRIPT_DIR); 
  if     (!file_exists($filePath)) { $configFilesList .= "<li style='color: #C00;'>$filePath (file not found)</li>\n"; }
  elseif ($isLoaded)               { $configFilesList .= "<li>$filePath</li>\n"; }
}

With this:

foreach ($configFiles as $configFile => $isLoaded) {
  $filePath           = absPath($configFile, SCRIPT_DIR); 
  $fileExists         = @file_exists($filePath);
  $isOpenBaseDirError = preg_match("/open_basedir restriction in effect/i", error_get_last()['message']);
  if     (!$fileExists && !$isOpenBaseDirError) { $configFilesList .= "<li style='color: #C00;'>$filePath (file not found)</li>\n"; }
  elseif ($isLoaded)                            { $configFilesList .= "<li>$filePath</li>\n"; }
}

Hope that helps, let me know any questions.

Dave Edis - Senior Developer
interactivetools.com

By Deborah - April 5, 2018

Dave, thank you so much!

I was concerned that the server setup might not be compatible w/CMSB and am relieved. Your code replacement has stopped the error logging.

~ Deborah