php.ini File Location in Ubuntu – How to Find, Open & Edit php.ini

php.ini file location in ubuntuphp.ini file location.

What is the php.ini file, why we use it ? Where do I find this file on Ubuntu ? How I open and edit the php.ini file on a terminal. This is the most common questions asked by beginners who are either new to PHP or Linux.

php.ini File

The php.ini file is a default configuration file used when your PHP application runs. When PHP starts it reads the configuration setting from the php.ini file.

If you have installed LAMP on a Ubuntu operating system and unable to find and edit this file then this tutorial is for you.

How to Enable/Install apache mod_rewrite and mod_headers in ubuntu

Last week while i was working on url rewriting i face the problem. I had written the rule in .htaccess but forget to enable the mod_rewrite. Remember your .htaccess rule will not work until you enable the mod_rewrite.

How to install apache2 on ubuntu

Go to terminal (ctrl+Alt+T) and write the following command

Once apache2 installation is complete. Write the command mentioned below to enable mod_rewrite

After enable the mod_rewrite do the changes on following file

After done the changes restart the apache.

To restart apache2

Enable mod_headers in apache

Remember to restart apache 

So to restart apache2 write through terminal