How to get php.ini file path?

藏色散人
Release: 2023-04-05 15:36:01
Original
3431 people have browsed it

We can use the php_ini_loaded_file() function in PHP to get the location path of the php.ini file.

How to get php.ini file path?

Sometimes we need to get the php.ini file path. Then if you need to get the path to the php configuration file, you can do the following:

The PHP code example is as follows:

print_r(php_ini_loaded_file());
Copy after login

Output:

D:\wamp\bin\apache\apache2.4.17\bin\php.ini
Copy after login

As shown above, We successfully obtained the path of the local php.ini file, namely D:\wamp\bin\apache\apache2.4.17\bin\php.ini.

Function introduction:

php_ini_loaded_file() functionGet the path of the loaded php.ini file

Syntax:

php_ini_loaded_file ( void ) : string
Copy after login

Check if there is a loaded php.ini file and get its path.

This function has no parameters. Returns the path to the loaded php.ini, or FALSE if none.

Related recommendations: "PHP Tutorial"

This article is about the method of obtaining the php.ini file path. It is very simple. I hope it will be useful to friends who need it. help!

The above is the detailed content of How to get php.ini file 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!