How to set the relevant configuration of the php path

coldplay.xixi
Release: 2023-03-06 21:08:02
Original
3170 people have browsed it

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.

How to set the relevant configuration of the php path

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template