Open In App

How to know which php.ini file is used ?

The php.ini file is the default configuration file used for running applications that require PHP. It is an effective way to work on PHP’s functionality. It is used to control variables like file timeouts, sizes of the upload, and the limits of the resource on which it works.

1. Check php.ini in CGI (Common Gateway Interface): Here, we can use two inbuilt functions to get which php.ini used.



2. Check php.ini in CLI (Command Line Interface): To know about php.ini, simply run on CLI.



php --ini

It look for Loaded Configuration File in output for the location of php.ini used by your CLI.

Note: If we run a PHP script from CLI, it is possible that a different php.ini file will be used than if a server (i.e. apache or Nginx ) runs it.

3. Other Options to know about php.ini:


Article Tags :