Page 1 of 1
include_path in php.ini; wondeering how it affects things
Posted: Wed Jul 21, 2004 8:19 am
by NewfieBilko
Hey guys, i am pretty newb when it comes to php. Anyway, can someone inform me on this magical include_path? is it just referencing my root directory to my php web folders? can it have any significance when coding? do tell!1
Posted: Wed Jul 21, 2004 9:59 am
by JAM
can it have any significance when coding
Depending on what type of coding you are doing.
Lets take the example of database abstraction layers. If you have 'your perfect code' that you allways tend to use, that you feel comfortable with, you can move that file (say db.php) into the auto_includes directory. That way, you can include/require the same file from anywhere within the tree structure of your site(s) without having to keep a copy within each of the projects folders.
There is also the thought of security involved. The files is only (so I really hope) available to PHP, meaning that a user cannot type in it's location in their browser to get to the file for whatever reason they want that.
Posted: Wed Jul 21, 2004 11:21 am
by pickle
The include path is where PHP first looks for a file when you include a file. So, if in any file, say you include('db.php'). PHP will first look in your include path to see if there's a file called db.php. If there is, it includes it, if not, it tries to include a db.php file in the relative location.
You can include files that are stored in your include path from any place on your server, without have to explicitly list it's absolute path.
Make sense?
Posted: Thu Jul 22, 2004 6:32 am
by NewfieBilko
totally
Posted: Thu Jul 22, 2004 8:54 am
by NewfieBilko
Guys, how about the extension_dir?
I am using virtual hosts.
Guess what.. I came into work this morning, after leaving yesterday and everything was fine- but low and behond, My system wasn't work. It says DB: Database Not Found when u naviagte it. When i run debug i get the same error. Although I can connect through navicat, but cannot through php myadmin. so it makes you think its something code side
Posted: Thu Jul 22, 2004 10:36 am
by feyd
did you remove the include for "." ? That may be the problem...
Posted: Thu Jul 22, 2004 11:05 am
by NewfieBilko
Here are my exact settings in the php.ini
This was edited yesterday, but I have put everything back to the way it was , I think.....
;UNIX: "/path1:/path2"
include_path = ".:/php/includes" (commenting gone)
;Windows: "\path1;\path2"
; include_path=".;c:\php\includes
I dont even know if i need this to be on.. I dont rmemeber if i had include path uncommented or not.
and my extension_dir = "/user/lib/php4" this is where i found mysql.so and 2 other .so files... should theree be quotes "" on this?
....... help

Posted: Thu Jul 22, 2004 11:05 am
by NewfieBilko
i keep getting god damn:
DB Error: not found
i think i <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> my application when i <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> with the php.ini yesterday.. i think i have everything restored.. check the post above and check me thx