Skip to content

Instantly share code, notes, and snippets.

@pvm-77
Created April 11, 2023 10:38
Show Gist options
  • Save pvm-77/7f64a00181e8d72e13fa092273ac7d18 to your computer and use it in GitHub Desktop.
Save pvm-77/7f64a00181e8d72e13fa092273ac7d18 to your computer and use it in GitHub Desktop.
how to find php.ini file in ubuntu

In Ubuntu, the location of the php.ini file can vary depending on the installation and version of PHP you are using, as well as the web server you are using. Here are a few common locations where you can find the php.ini file:

  1. /etc/php/7.4/apache2/php.ini This is the default location for the php.ini file for PHP version 7.4 on Apache web server.

  2. /etc/php/7.4/cli/php.ini This is the php.ini file used by the PHP command-line interface (CLI).

  3. /usr/local/etc/php/php.ini This is the location for the php.ini file on some installations of PHP.

To find the location of the php.ini file on your system, you can use the following command in the terminal:

php -i | grep 'Loaded Configuration File'

This will output the path to the php.ini file that is currently being used by your PHP installation. Once you have located the php.ini file, you can open it in a text editor to make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment