What is and what is php.ini for?

6

It may even be a simple question but I wonder what is the php.ini and its use for a site / system.

If possible, I would like good references (not always the meeting) that can help in the explanation as well.

    
asked by anonymous 19.11.2015 / 14:28

2 answers

7

It is a settings file. It has directives on how PHP should behave regarding memory usage, paths, installed modules and their own settings, what parts of PHP can be used and how they will be, different usage limits, etc. It has a default format called INI .

In general, it has settings that work well for all sites, but you can have multiple versions of it, and for each site you load one with the most appropriate settings. Of course you must have control of the hosting to accomplish this. A few shared ones let you choose this from the control panel.

The primary references are in the official manual.

Most of these policies can be changed at run time. If php.ini leaves: P.

More information about the INI file .

    
19.11.2015 / 14:32
3

PHP.ini is the file where are PHP settings ranging from extensions, directives, configuration of directories like log, standard locale.

It serves to define specific settings of a system or environment (approval and production), basically this file defines which 'rules' PHP should obey by default. Some settings can be redefined at run time with the ini_set('diretiva', 'valor') function.

Ex: Reduce error display:

ini_set('display_errors', true);
    
19.11.2015 / 14:38