Methods to set the configuration related to the PHP path path: 1. [get_include_path()] to obtain the current environment variable; 2. [dirname (_FILE_)] The path of the current script file; 3. [dirname(dirname(_FILE_ ))】The directory of the previous level.
Methods to set php path path related configuration:
1. get_include_path() to obtain the current environment variable, That is, the include_path set in php.ini;
set_include_path() is the path to set the include. After this setting, you can use include("conn.php") directly in other pages;
2. __FILE__: global variable, the full path of the file;
dirname (_FILE_): the path of the current script file;
dirname(dirname(_FILE_)): the upper-level directory.
PATH_SEPARATOR: path separator windows(;),Linux(:);
Related video recommendations: PHP programming from entry to proficiency
The above is the detailed content of How to set the relevant configuration of the php path. For more information, please follow other related articles on the PHP Chinese website!