IT Community - Software Programming, Web Development and Technical Support

open_basedir restriction in effect error in PHP

This is a discussion on open_basedir restriction in effect error in PHP within the PHP Programming forums, part of the Web Development category; This must be one of the most annoying errors to get when working with php. This error occurs when PHP ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 07:05 AM
BenR41 BenR41 is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 5
BenR41 is on a distinguished road
Default open_basedir restriction in effect error in PHP

This must be one of the most annoying errors to get when working with php. This error occurs when PHP can't find the specified file in the include statement. This often occurs when a developer has built an application on their machine and uploaded the application to a shared hosting account or if they move the application to a sub folder.

An easy work around is to determine the path to the called file dynamically.


$folcnt = substr_count($_SERVER["PHP_SELF"], "/");
$folappstep = "";
if($folcnt > 1) {
for($i=2;$i<=$folcnt;$i++) {
$folappstep .= "../";
}
} else {
$folappstep = "";
}

$extfile = $folappstep."ws8_extensions.php";
$funfile = $folappstep."ws8_functions.php";

include $extfile;
include $funfile;

Good luck

Ben
LTS Media Ltd.
LTS Media:: Strategic Online Planning & Project Management
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tint effect nssukumar Flash Actionscript Programming 1 02-26-2008 10:05 PM
How can I tell when Daylight Saving is in effect? itbarota HTML, CSS and Javascript Coding Techniques 1 01-01-2008 08:40 PM
Magnifying Glass Effect aramesh Flash Actionscript Programming 0 12-12-2007 10:32 PM
Cause-Effect Graphing Techniques Shanthi Software Testing 1 11-16-2007 04:39 AM
Drop shadow effect using css muthukumar HTML, CSS and Javascript Coding Techniques 0 07-17-2007 12:43 PM


All times are GMT -7. The time now is 03:02 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0