|
Posted by Gordon Burditt on 11/25/06 17:44
>> There are plenty of situations where this will happen. If a file
>> name begins with ./, it will be looked up with include_path relative
>> only to the current working directory, not the current script.
>>
>> Are you SURE you know what the current working directory is when
>> the script is started?
>
>The dicrecory is named 'test'.There's no file name like './',
One of the file names you passed to include() began with period slash.
The comma is punctuation in the sentence.
>All files
>in it ara 'info.php' and 'inc.php', if the current working directory is
>'test' when i browse 'info.php'?
If file_exists('inc.php') returns false, then the current working
directory is a directory that does NOT have an inc.php in it. On
the other hand, the directory the script is in apparently DOES have
an inc.php in it. include('inc.php') searches both places.
include('./inc.php') only searches the first one. Are you SURE you
know what the current working directory is when the script is
started?
>In this case if the two way to include is different?
Read the documentation on include(). If the file name begins with
period slash, fewer directories are searched.
include('inc.php') may search in a lot of places.
include ('./inc.php') may search in fewer places.
file_exists('inc.php') looks in ONE place.
>> include() uses include_path to search for files.
>> file_exists() doesn't.
>
>I never set include_path before using win2003 and the win2000 server
>run well.
Are all the path names on win2000 and win2003 *EXACTLY* the same?
So what is the value of include_path? If you didn't set it, there's
a default value.
>> >my environment is win2003+iis+php5
>> >
>> >how to fix it ?
>>
>> The fix may be to correct the "right" value. Don't think that!
>
>I think you can tell me how to resolve this problem..thanks :)
Print out the current working directory by calling getcwd() and echo
the value. Is it the value you thought it was?
Navigation:
[Reply to this message]
|