Reputation: 339
I have a problem with configuring my app in a server and googling and looking around I landed on this page which pretty much is my problem but I still don't know how to change this into my situation so could someone explain the syntax of this expression.
include_path = ".:/usr/lib/php:/usr/local/lib/php"
Upvotes: 3
Views: 1547
Reputation: 219824
That is just a colon-delimited list of directories that PHP will search for files that are called via include()
and require()
(and their include_once()
and require_once
friends). If you want to add your own directories you would add them as such:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/path/to/your/includes"
/path/to/your/includes
is the sample path to where your included files will be
Upvotes: 3
Reputation: 7054
This is a linux $PATH
specification. It's a list of folders, separated by :
s, in which PHP will look for files which you try to require
or include
. .
means the current working directory.
Upvotes: 4
Reputation: 522125
The include_path
is all the paths in which PHP will look for the file when you use include('file')
(or require
or the _once
derivatives). It is several paths separated by :
. The .
path is the current working directory.
So, when you include('file.php')
, PHP will first look for ./file.php
(in the current directory), then /usr/lib/php/file.php
, then /usr/local/lib/php/file.php
and it will use the first file it finds.
Upvotes: 3