There are several ways to find php.ini file location in Linux as listed below.
Using the php command:
1 2 |
## Best and simplest way php --ini | grep php.ini |
Alternative method one of finding php.ini:
1 2 |
## alternative 1 php -r "phpinfo();" | grep php.ini |
Alternative method two of finding php.ini:
1 2 |
## alternative 2 locate php.ini |
Alternative method three of finding php.ini:
1 2 |
## alternative 3 sudo find / -name php.ini |