Where is php ini editor in ubuntu?

The php.ini file is a default configuration file that read on PHP starts up. The PHP settings and configuration can be modified by the php.ini file.

If you want to change the PHP settings on Ubuntu, php.ini file is an easy and most effective way to do it. Follow the below steps to modify the PHP configuration file (php.ini) using the command line on Ubuntu.

  • Open the terminal and run the following command to open the php.ini file.
    sudo nano /etc/php5/apache2/php.ini
  • Change the PHP settings. For example, if you want to increase the execution time, increase the max_execution_time variable value in seconds.
    max_execution_time = 90
  • Once you modified the PHP configuration values as per your needs, save changes and exit editor.
  • Now restart the web server to enable the changes you have done.
    sudo service apache2 restart
edit php ini ubuntu 18 04 nginx, how to edit php file in ubuntu terminal, how to edit php ini file in ubuntu terminal, how to edit php ini file using, php 7 2 php ini location, php ini file location ubuntu, restart php ini ubuntu

In this tutorial, we are going to see how to edit PHP ini file in ubuntu terminal. php.ini file is a default configuration file that is read when PHP is started. PHP settings and configurations can be changed through php.ini.

If you want to change PHP configurations on Ubuntu, the php.ini file is a simple and effective way. Follow the steps below to modify the PHP configuration file (php.ini) on the terminal in Ubuntu.
 
1. Open the terminal and run the following command to open the php.ini file.

sudo nano /etc/php5/apache2/php.ini

2. Change PHP parameters. For example, if you want to increase the execution time, increase the value of the variable max_execution_time in seconds.

max_execution_time = 60

3. Once you have changed the configuration values, save and exit the editor.
4. Now restart the web server to activate the changes you have made.

sudo service apache2 restart

 

Where is php ini editor in ubuntu?
Where is php ini editor in ubuntu?
Where is php ini editor in ubuntu?
MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.

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.

PHP Script to Find php.ini Location

If you are working on  Windows, Ubuntu or any operating system. You can easily find the location of php.ini configuration file using simple PHP script.

Create a PHP file. Let’s name it inipath.php (you can choose any name with a .php extension) .

Java

1

2

3

4

5

<?php

 

phpinfo();

 

?>

Open this file in your browser and you will get the path of  the php.ini.

Where is php ini editor in ubuntu?

I am using Ubuntu and the location of php.ini in Ubuntu is /etc/php5/apache2/php.ini . Similarly, if you are running this script on Windows and Mac you’ll get the path as per their directory structure.

For version 7.4.3, the php.ini path is /etc/php/7.4/apache2/php.ini.

Where is php ini editor in ubuntu?

php.ini File Location in Ubuntu

For PHP5

The path of php.ini in Ubuntu is /etc/php5/apache2 . Open the terminal and start typing following commands.

Java

1

2

3

$ cd  /etc/php5/apache2

 

$ ls

To view the files present in apache2 directory, type ls command. The files present in this directory (conf.d and php.ini) are displayed.

For PHP 7.4 version

The path of php.ini is

Java

1

2

3

$ cd  /etc/php/7.4/apache2

 

$ ls

If you are not familiar with Linux commands then read my previous post on Linux Commands with Examples .

The other easiest way to locate the php.ini location is using locate command.

Java

1

$ locate php.ini

How to open & edit the php.ini configuration file on a Terminal

To open & edit the php.ini file I am using vim/vi editor.

Read more about Beginners guide for vi/vim editor.

Java

1

$ sudo vim php.ini

You can directly open this file using the following command.

Java

1

$  sudo vim /etc/php5/apache2/php.ini

NOTE – Once you have done the changes in the php.ini file. You need to restart the apache web server so that the new changes get reflected.

To restart the Apache WebServer.

Java

1

$ sudo /etc/init.d/apache2 restart

or

Java

1

$ sudo service apache2 restart

Abstract vs Interface in PHP

Abstract class in PHP

Programming Videos Tutorial

Conclusion

I hope this tutorial helped you to find and edit the php.ini file. If you are still facing any issue you can ask your question through comments.

How do I open php ini in Ubuntu terminal?

To open php. ini file in Linux terminal and just use vim or vi command. For example : vim /etc/php. ini.

Where is the php ini file located?

ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.

How to change php settings in Ubuntu?

How to Modify the PHP Configuration File on Ubuntu.
Open the terminal and run the following command to open the php. ini file. ... .
Change the PHP settings. ... .
Once you modified the PHP configuration values as per your needs, save changes and exit editor..
Now restart the web server to enable the changes you have done..

How to edit the php ini file?

Modifying the PHP..
Login to the cPanel..
Find the File Manager in File section of the cPanel. ... .
Navigate to the directory where you will either save or edit the PHP. ... .
Edit the section of the PHP. ... .
Click on SAVE CHANGES in the top right hand corner in order to save your modifications or additions to the file..