Categories: Ubuntu

Where is php.ini Configuration File 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 use the file to customize the PHP environment too according to your choice. This file also includes some derivatives that help you control various aspects of PHP, such as memory limit, file size, error reporting and much more.

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

Where is php.ini Configuration File in Ubuntu

There are multiple ways to find the location of php.ini

Sponsored
configuration file in Ubuntu:

Method 1: Through Browser

To find php.ini configuration file via the browser on Ubuntu, follow the below-given steps:

Step 1: First create a phpinfo.php file in the default HTML root folder on Ubuntu system from the following command:

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

 

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

?php

// Show All PHP Information
phpinfo();

?>

 

Step 3: Now, head towards your system browser and enter the address http://127.0.0.1/phpinfo.php.

Sponsored

Method 2: Through Terminal

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

The first one is running the following command on the terminal to find the location of php.ini configuration file:

php –ini

 

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

php –ini | grep Loaded

 

You can also run the PHP interactive shell to find the location of the php.ini file. For that purpose, first open the PHP interactive shell from the following command:

php -a

 

Then execute the following command to get the location of the php.ini configuration file on the Ubuntu system.

phpinfo();

 

Conclusion

php.ini is the PHP configuration file that you can utilize to run PHP applications on the system. You can find the location of this file on the Ubuntu system by creating a .php file, inserting a PHP code inside it and access it on the browser. Alternatively, the Ubuntu users can also find php.ini file location from the php –ini command on the interactive shell using phpinfo(); command.

Ubuntu Server Admin

Recent Posts

Warzone 2100 Released 4.6.0 with Spectator Host Mode

Warzone 2100, the free open-source 3D real-time strategy game, released new major 4.6.0 version few…

6 hours ago

What our users make with Ubuntu Pro – Episode 2

How Vaultara achieved FedRAMP compliance with Ubuntu Pro Ubuntu Pro helps businesses worldwide to innovate…

23 hours ago

How To Install Zabbix Server 7.4 On Ubuntu 22.04

Zabbix is smart monitoring system on your network. This software written by php mysql. So…

1 day ago

How To Install Zabbix Server 7.2 On Ubuntu 22.04

Zabbix is smart monitoring system on your network. This software written by php mysql. So…

1 day ago

SuperTuxKart 1.5 RC2 added GUI option to Choose Vulkan or DirectX 9

SuperTuxKart, the 3D kart racing game, announced the second release candidate for the next 1.5…

1 day ago

What’s the state of open source adoption in Europe?

New research suggests 86% of European organizations believe open source is valuable for the future…

2 days ago