Welcome to WebmasterWorld Guest from 54.147.44.13

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

include_path

what include_path in <? phpinfo?>

     
6:24 am on Sep 24, 2002 (gmt 0)

Full Member

10+ Year Member

joined:May 9, 2002
posts:241
votes: 0


newbie question

If the "include_path" was set to: ".:/php/includes:/usr/etc/php" does that mean i could only include files that resides in that directory?

thanks.

6:58 am on Sept 24, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 30, 2001
posts:373
votes: 0


That is a list of directories. They are seperated by colons (you know, ":"). You can include things from any of those directories or subdirectories thereof. A dot (".") means "the current directory", so you can put includes in the same directory as the files that include them.
6:59 am on Sept 24, 2002 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


from php.net [php.net]

Specifies a list of directories where the require(), include() and fopen_with_path() functions look for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in UNIX or semicolon in Windows.

The default value for this directive is . (only the current directory).

I don't believe so, if you give just a file name like so

include "header.html";

I think it looks in the specified dirs from the include_path, but if done as so

include $DOCUMENT_ROOT . "/header.html";

I believe it would look in the path specified by your include because the path is absolute, not relative. Not 100% sure, but that is my informed guess.

10:18 pm on Sept 24, 2002 (gmt 0)

Full Member

10+ Year Member

joined:May 9, 2002
posts:241
votes: 0


Thanks for all the information.

This help clarify things up.

peace. :)

10:22 pm on Sept 24, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:July 16, 2001
posts:545
votes: 0


I noticed, while poking through the fusebox source for PHP, that there is also a chdir function, that lets you change the directory that you are relative to.

example:
You start generally in your /public_html(or /www or whatever). But for security reasons, you drop your file with db password et al, to a directory outside of your webroot. You can chdir to that directory, and all your include's are local! (no explicit pathing)

Just remember to take note of where you are before you move, in case you want/need to go back.

3:46 pm on Oct 17, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 28, 2002
posts:76
votes: 0


I am busy with the script of a guestbook. Now I need to put the UNIX path for a html page on my web.

As a starter I would not know how to get that.

Can anyone tell me how you look that up? ..and through what software.

Thanks already.

5:23 pm on Oct 17, 2002 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


FrankWeb,
Your host should be able to provide that for you. Some script languages like PHP have a function that will return all of the server's parameters. For PHP it's phpinfo();

BTW - welcome to WebmasterWorld!:)