Where is the configuration file php.ini in Ubuntu

php.ini is the default configuration file for the PHP programming language. It makes it easy for users to run PHP applications and you can also use the file to customize the PHP environment to your liking. This file also contains some derivatives to help you control various aspects of PHP such as: B. Storage limit, file size, error reporting and much more.

If you are looking for the location of this file on Ubuntu system, you can follow this guide for different ways to find the php.ini location.

Where is the configuration file php.ini in Ubuntu

There are several ways to find the location php.ini configuration File on Ubuntu:

Method 1: Via the browser

Find php.ini Configuration file via the browser on Ubuntu, follow the steps given below:

Step 1: Create one first phpinfo.php File in the default HTML root folder on the Ubuntu system with the following command:

sudo nano /Var/www/html/phpinfo.php

Step 2: In the file, add the following PHP code.

<?php

// Show all PHP information
phpinfo();

?>

Step 3: Now go to your system browser and type the address https://127.0.0.1/phpinfo.php.

Method 2: Through Terminal

There are some useful terminal methods that will make it easier for you to find them php.ini Configuration file in the Ubuntu system.

The first runs the following command on the terminal to find the location of php.ini Configuration file:

php –ini

Just to get the location of the php.ini file on the Ubuntu system, you can use the following modified command:

php –ini | grep loaded

You can also run the interactive PHP shell to find the location of the php.ini file. To do this, first open the interactive PHP shell with the following command:

php -A

Then run the following command to get the location of the php.ini Configuration file on the Ubuntu system.

phpinfo();

Diploma

php.ini is the PHP configuration file that you can use to run PHP applications on the system. You can find the location of this file on the Ubuntu system by creating a .php file, putting some PHP code in it and accessing it in the browser. Alternatively, the Ubuntu users can also find the location of the php.ini file php -ini Command on the interactive shell with phpinfo(); Command.

Related Posts