Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between php.ini Configuration File location and Loaded configuration file?

Tags:

php

What is the difference between configuration file and loaded configuration file?

If ini file is loaded from "C:\Program Files (x86)\PHP\php.ini ", what does ini inside C:\Windows mean?

Output of phpinfo()

Configuration File (php.ini) Path C:\Windows 
Loaded Configuration File C:\Program Files (x86)\PHP\php.ini 

If i have to change some config, should i modify both files?

like image 987
P K Avatar asked Feb 12 '12 08:02

P K


People also ask

What is PHP ini configuration file?

The php. 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. php. ini file is the configuration file.

Where is location PHP ini?

ini is usually located in /etc/php/8.1/fpm/php.

What is the difference between PHP ini development and PHP ini production?

ini-development contains settings suitable for development environment and php. ini-production contains settings suitable for production environment. As per your requirement, you need take backup of anyone of the file and rename that file to php. ini .

How do I know which PHP ini is being used?

Check php. ini in CLI (Command Line Interface): To know about php. ini, simply run on CLI. It look for Loaded Configuration File in output for the location of php.


2 Answers

"Configuration File (php.ini) Path" is where by default php.ini should be/PHP will look for by default (this path is may be the %windir env var for Win distro?).

I believe that in your apache config you have PHPINIDir, that define explicitly a new path to the ini file. If you don't have php.ini in there, then PHP defaults will be used (even if you have php.ini in the C:\Windows folder). At least this is the case when PHP is used as module (which is my config and I'm able to test on).

So "Loaded Configuration File" is your currently loaded config file and the one you should edit.

like image 131
Boris Belenski Avatar answered Oct 21 '22 08:10

Boris Belenski


The Loaded Configuration File is the correct one. Not sure what the other is supposed to mean. Change the Loaded one.

Also is there really a php.ini file in C:\Windows? I guess not.

like image 22
mbh Avatar answered Oct 21 '22 09:10

mbh