Welcome to WebmasterWorld Guest from 54.197.94.141

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)

10+ Year Member



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 Sep 24, 2002 (gmt 0)

10+ Year Member



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 Sep 24, 2002 (gmt 0)

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



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 Sep 24, 2002 (gmt 0)

10+ Year Member



Thanks for all the information.

This help clarify things up.

peace. :)

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

10+ Year Member



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)

10+ Year Member



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)

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



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!:)