PHP - How to find the php.ini configuration file
- Last updated: Nov 3, 2023
- Views: 252
- Author: Admin
In the PHP programming language, the php.ini file is the main configuration file. The moment the php interpreter starts, it first looks for the php.ini configuration file and loads it. That file stores all the parameters that are responsible for the normal operation of the interpreter. The location of the php.ini file is highly dependent on the environment in which you are using PHP.
In this article, we will show you a few tricks that will show you where the php.ini configuration file is located.
The content of the article:
- php_ini_loaded_file function.
- ssh commands.
1. Function php_ini_loaded_file.
The php_ini_loaded_file() function shows the path to the php.ini configuration file. If there is a problem loading the configuration file, the function will return FALSE.
2. SSH commands.
You can also use SSH console commands to find out where you have your php.ini configuration file.
$. php --ini
$. php -i | grep php.ini
$. php -i | grep "Configuration File"
Thank you all, I hope my article was of some help to you.