The meaning of 1.include_path
When the function include (), require (), Fopen_with_path () function to find the file. Without setting the include_path, these functions are found by default in the Web root directory when they open files. When setting up Include_ Path, these php functions are searched for under the specified include_path directory first.
Its Principle and window system environment variable similar, when the window runs cmd command, input some cmd command after the system will be in its set environment variables to search for the existence of these commands, exist can be executed.
Settings for 2.include_path
The first method:
Modify the Include_path item 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 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 that is a ":" Number in a Linux system and a ";" on Windows. Resolution
Therefore, it is best to write the program with constant Path_separator instead, otherwise if the system from Linux to the win system or transplant to the reverse will be wrong!
Get_include_path gets the current existing environment variable, plus the previous setting is the new system include