The meaning of 1.include_path
When the function include (), require (), Fopen_with_path () function to find the file. When you do not set include_path, these functions open files by default when you look for them in the Web root directory. When setting the Include_ After path, these php functions are searched for under the specified include_path directory.
The principle is similar to the environment variables of the window System, when window runs the cmd command, the system will search for the existence of these commands in the environment variables they set, and then it can be executed.
Settings for 2.include_path
The first method:
Modify the Include_path entry in the php.ini file.
include_path =.:/ Usr/local/lib/php:./include
A second method:
Use the Ini_set method.
Ini_set ("Include_path", ".:.. /:./include:.. /include ");
3. Note
Zendframework include settings index.php
Copy the Code code as follows:
Set_include_path ('. '). Path_separator. /library/'
. Path_separator. '. /application/models/'
. Path_separator. '. /application/lib/'
. Path_separator.get_include_path ());
Path_separator is a constant, in the Linux system is a ":" Number, Windows is a ";" No.
Therefore, it is better to write a program with a constant path_separator instead, or if the system from Linux to the win system or the reverse migration will be wrong!
Get_include_path gets the current environment variable, plus the previous setting is the new system include
The above describes the Patcharapachaichua PHP include_path Setup skills to share, including the patcharapachaichua aspects of the content, I hope that the PHP tutorial interested in a friend helpful.