|
Posted by Kim Andrι Akerψ on 10/21/05 11:26
mirko@abitur97.de wrote:
> Hello,
>
> I have a problem with my include_path and I don't know why... Can
> anybody see the mistake?
>
> my configuration:
>
> PHP Version 4.3.11
>
> System: Windows NT 5.0 build 2195
> Server API: CGI/FastCGI
> Virtual Directory Support: enabled
> Configuration File (php.ini) Path: C:\WINNT\php.ini
> PHP API: 20020918
> PHP Extension: 20020429
> Thread Safety: enabled
> include_path: .;C:\Inetpub\wwwroot
>
> My php script used this:
>
> require("/development/classes/configWeb.php");
>
> and the configWeb File location is:
> C:\Inetpub\wwwroot\development\classes\configWeb.php
>
> And I geet this error message:
> Fatal error: getofficeslist(): Failed opening required
> '\development\classes\configWeb.php'
> (include_path='.;C:\Inetpub\wwwroot') in
> C:\Inetpub\wwwroot\development\classes\offices.php on line 45
What your script is actually trying to access, is
"c:\development\classes\configWeb.php", which is referenced in the
require() statement above. If you remove the slash from the beginning
of that file reference, you'll see that it works.
The way include_path works, it goes through each of the directories
(seperated by a semicolon) when you use include/require with a relative
path until it finds the file. This is only a side feature, since
include_path is meant to secure which directories a script is allowed
to include files from.
It will in your case look for the included file here (if making the
change I suggested):
..\development\classes\configWeb.php (from current working directory)
c:\Inetpub\wwwroot\development\classes\configWeb.php
--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Navigation:
[Reply to this message]
|