What happens if php does not have a php.ini file?

  • Today, when the new server compiles and installs Php, it is found that there is no php.ini file!
  • I also know that you can copy php.ini-development or php.ini-production files to the source package!
  • but when I don"t have the php.ini file, php still works, and php-fpm has started properly, so I"m curious.
  • how does php read the configuration when there is no configuration file php.ini?

-Please take a look at the following question if you can. Thank you, ORZ-

.

BTW: later I copied php.ini-development to the installation location and then started php-fpm unexpectedly reported an error, saying that some libraries could not be loaded, because there was no such libraries under the no-debug-non-zts folder, but I took these libraries with me and enabled them when compiling. Where did I find these libraries when there was no php.ini file?

May.12,2021

for the simplicity and ease of use of the program. Does every configuration have a default value?


self-answer. You can see the loaded php.ini path in phpinfo (), as shown in the figure:


nfiguration File (php.ini) Path    /usr/local/php/lib ini
Loaded Configuration File    (none)
Scan this dir for additional .ini files    (none)

how to explain this?

Menu