homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

what include_path in <? phpinfo?>

 6:24 am on Sep 24, 2002 (gmt 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?




 6:58 am on Sep 24, 2002 (gmt 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 Sep 24, 2002 (gmt 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 Sep 24, 2002 (gmt 0)

Thanks for all the information.

This help clarify things up.

peace. :)


 10:22 pm on Sep 24, 2002 (gmt 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.

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)

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)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved