How can I find the php.ini file used by the command line? September 16, 2022 by Tarik Just run php --ini and look for Loaded Configuration File in the output for the location of php.ini used by your CLI.