What Is a php.ini File? As all, we know PHP is an open-source scripting language which means we can modify PHP configuration according to our use. So, the php.ini is the main configuration file of PHP that we used to modify the execution time, upload file size, and much more.

PHP INI file is created at the time of PHP installation. If you install XAMPP there is also an auto-generated PHP INI configuration that we use to set up the maximum upload size for our PHPMYADMIN database.

Use of PHP INI File

Here is a list of major use of the PHP INI configuration file.

  • By using the INI configuration file we can increase PHPMyAdmin DB Import Size.
  • We can maximize the execution time of PHP files or prevent timeout issues (max_execution_time).
  • It is used to disable error reporting like PHP error notices and warnings (error_reporting).
  • Also, we can enable and disable file upload functionality by using PHP INI configuration (file_uploads).
  • Set memory limit for PHP scripts which allows the script to take defined memory (memory_limit).

Example of PHP.INI File

In this example, I will show you how you can increase your upload size limit,

Please note that after you do these changes you have to restart your servers.

php.ini File Location In XAMPP

your_drive/xampp/php/php.ini

Go to your installation directory then find the folder named xampp. Now check the path which I show you above.

How to Create php.ini File

You can also create a PHP.INI file in your project root directory to override the setting of the default configuration.

To create a php.ini file, you just create a file name with php.ini and set your configuration as suggested in the above example. And then save it.

php.ini File Location in cPanel

php.ini file location in cpanel
  1. Open your cPanel and search of MultiPHP INI Editor.
  2. You get the same, now click on it and select the version of PHP from the dropdown.
  3. You get your configuration page where you can modify the values according to your use.
basic setting of PHP ini configuration

Here is the complete guide for the PHP INI configuration file and its use with examples.

Please let the comment below if you get any issues.

To know more about PHP configuration you can check here https://www.php.net/manual/en/configuration.file.php.

Also Read:

Happy Coding..!

Was this article helpful?
YesNo

By Bikash

My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH. I am a web Programmer by profession and working on more than 50 projects to date. Currently I am working on the web-based project and all the CMS and frameworks which are based on PHP.

One thought on “What Is a php.ini File and Its Use”

Leave a Reply

Your email address will not be published. Required fields are marked *