What is php.ini and its use ?

As we all know that php is one of the most common and popular web development language and every language  platform comes with its some basic configurations files.

The the configurations files in php is called the php.ini files through which we can immediately customize the behaviour of the php at the runtime  . When the php or apache server starts it looks for the PHP.ini files first to load the various settings of the server .

 In other words whenever httpd ( Apache Server ) is re-started for module version,with each script execution for the CGI version.
 If your change is not showing up, remember to stop and restart httpd. If it still is not showing up, use phpinfo() to check the path to php.ini.

You can manipulate the behaviours of php like 

  • Setting the time of executions 
  • Maximum upload size and time 
  • Errors reporting 
  • Setting the path for server variables like session ( storage path) by default is the tmp directory
  • Log errors 
  • Register global variables and many more ……….

Custom and overriding the php.ini file 
  • You can also create an custom php.ini for file for custom configuration for your projects where you can define the custom setting for your projects .
  • You can add the php.ini at the base directory of your project and you will be able to override the some basic functionality if the server configuration 
  • But you should need the enable the overriding functionality on the server php.ini configuration file .

Leave a Reply

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