| | |
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 |
# 5.2.10 action address apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display dissertation domain dynamic echo echo$_get[x]changingitintovariable... email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image images include insert ip javascript joomla legislation limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop open paypal pdf persist php popup problem query radio random record recursion remote script search server sessions sms sockets source space sql syntax system table tutorial update upload url validator variable video web youtube





