| | |
open_basedir restriction in effect error in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2008
Posts: 2
Reputation:
Solved Threads: 0
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.
Thanks
Ben
Lts Media Ltd.
>snipped<
An easy work around is to determine the path to the called file dynamically.
PHP Syntax (Toggle Plain Text)
$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;
Ben
Lts Media Ltd.
>snipped<
Last edited by MattEvans; Feb 25th, 2008 at 3:05 pm. Reason: Use [code] tags, don't use a fake signature.
I do realize this was a fake post and an advertisement (judging from the snipped signature) but I'd like to add my five cents anyway, because the method described above is pretty crude.
An easy and elegant method is:
BTW: Thanks for removing the ad. When we're at it, how about to close the thread as well so that it doesn't appear in unanswered threads search results? Thanks.
An easy and elegant method is:
php Syntax (Toggle Plain Text)
include dirname(__FILE__)."/ws8_extensions.php"; include dirname(__FILE__)."/ws8_functions.php";
Petr 'PePa' Pavel
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
![]() |
Similar Threads
- CakePHP installation problem (PHP)
- PHP in a html page? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Help No output??? php noob
- Next Thread: PHP file reading error
| Thread Tools | Search this Thread |
apache api array basic beginner broken cache cakephp class cms code computing confirm countingeverycharactersfromastring cron curl customizableitems database date delete dynamic echo email error fcc file filter folder form forms forum freelancing function functions gc_maxlifetime google header headmethod howtowriteathesis href htaccess html iframe image include incode ip javascript joomla limit link login malfunction match memmory memory menu method mod_rewrite multiple mysql navigation neutrality oop pagerank parsing paypal pdf php phpmysql query question random recursiveloop root script search select server sessions sms snippet soap source space sql support! system table template thesishelp trouble tutorial upload url variable video web window.onbeforeunload=closeme; youtube





