Reputation: 12957
I'm using PHP 7.2.10 on my laptop that runs on Windows 10 Home Single Language 64-bit operating system.
I've installed Apache/2.4.34 (Win32) and PHP 7.2.10 using the latest version of XAMPP.
Today, I come across the following statement from PHP Manual :
The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation.
Above text has created following doubts in my mind :
The configuration file (php.ini) is read when PHP starts up.
But it's not saying who does read it? Is it the PHP parser or the Apache web server? Or something else? Please explain to me.
In case of CGI and CLI versions, why the php.ini file is read again and again and who reads it?
In case of CGI and CLI versions, the process of reading the php.ini file happens on every invocation? What does mean by this sub-clause every invocation?
How many php.ini files can possibly be exist there? If such more than one files exist then what's the role of every such php.ini file?
P.S. : All the above questions have been asked to me in a technical interview.
P.S. : I know that php.ini is the main configuration file with all the configuration setting on the local machine.
Upvotes: 0
Views: 427
Reputation: 34426
Upvotes: 4