473,466 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

to stupid to see the mistake - include_path don't work

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.p hp

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

THANKS !

Oct 21 '05 #1
3 1897
mi***@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.p hp

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.p hp

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Oct 21 '05 #2
On 21 Oct 2005 00:09:04 -0700, mi***@abitur97.de wrote:
require("/development/classes/configWeb.php");


my guess is that this should be like this:
require("development/classes/configWeb.php");
--
- Marketer to coder: "You start coding. I'll go find out what they want." -
mail: kr***@binel-withoutspam.hr | uin: 2040925
Oct 21 '05 #3
Thanks for the description how include_path works. Now it works!

Mirko

Oct 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
3
by: webguynow | last post by:
I'm a little confused, I have test apps, using Pear DB.php but in my application, and debugging through Zend studio, I have some Database updates obviously working and then I get a Fatal Error....
2
by: Chuck Anderson | last post by:
My shared host used to have Php configured such that I could place a php.ini file into any directory on my site and that was the php.ini file that the Php cgi would use when it ran scripts. ...
24
by: Paul | last post by:
I am taking over an existing app and having trouble understanding their references. They have encapsulated Pear packages in the directory structure like: /site /site/html/Pear.php...
10
by: Schraalhans Keukenmeester | last post by:
I suspect the following problem IS hosting provider specific, but they haven't been able to help me out so far. Perhaps I am doing something wrong and someone is able to spot the issue... Here...
9
by: Charles Crume | last post by:
Hello Everyone; My site was hacked the other day -- someone was able to rename my index.shtml file and put their own index.html file on my server. Not sure how it was done, but looking through...
2
by: Rob Wilkerson | last post by:
Hey all - I'm trying to create a developer-friendly environment on my production server. By that, I mean an environment where developers don't need to worry about certain things. Among those...
4
by: Gordon | last post by:
Is it possible in, say, a .htaccess file, to append additional paths to the php include_path without knowing what the value of include_path is beforehand? I want to add an absolute path to a...
0
by: mukeshrasm | last post by:
Hi! I want to use phpmailer class to send mail using smtp.I have downloaded the phpmailer and then i followed it's README file where it is mentioned that "Copy class.phpmailer.php into your php.ini...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.