Home  >  Article  >  Backend Development  >  How to Determine the Active php.ini File in PHP Scripts?

How to Determine the Active php.ini File in PHP Scripts?

Patricia Arquette
Patricia ArquetteOriginal
2024-10-24 18:58:29965browse

How to Determine the Active php.ini File in PHP Scripts?

Finding the Active php.ini File in PHP Scripts

In a Linux Ubuntu server, it is possible to encounter multiple php.ini files when using the 'find' command. To determine the exact active file for a PHP script on a web page, there are several methods:

  1. php --ini: This command displays the path to the php.ini file being used and any additional ini files that were loaded.
  2. phpinfo(): For webserver SAPIs, using the phpinfo() function provides information about the active php.ini file.

Example output:

php --ini
Configuration File (php.ini) Path: /usr/local/php5/lib
Loaded Configuration File:         /usr/local/php5/lib/php.ini
Scan for additional .ini files in: /usr/local/php5/php.d
Additional .ini files parsed:      /usr/local/php5/php.d/10-extension_dir.ini,
/usr/local/php5/php.d/20-extension-opcache.ini,
/usr/local/php5/php.d/40-openssl.ini,
/usr/local/php5/php.d/50-extension-apcu.ini,
/usr/local/php5/php.d/50-extension-curl.ini,
/usr/local/php5/php.d/50-extension-gmp.ini,
/usr/local/php5/php.d/50-extension-imap.ini,
/usr/local/php5/php.d/50-extension-intl.ini,
/usr/local/php5/php.d/50-extension-mcrypt.ini,
/usr/local/php5/php.d/50-extension-mssql.ini,
/usr/local/php5/php.d/50-extension-pdo_pgsql.ini,
/usr/local/php5/php.d/50-extension-pgsql.ini,
/usr/local/php5/php.d/50-extension-propro.ini,
/usr/local/php5/php.d/50-extension-raphf.ini,
/usr/local/php5/php.d/50-extension-readline.ini,
/usr/local/php5/php.d/50-extension-xdebug.ini,
/usr/local/php5/php.d/50-extension-xsl.ini,
/usr/local/php5/php.d/60-extension-pecl_http.ini,
/usr/local/php5/php.d/99-liip-developer.ini

The above is the detailed content of How to Determine the Active php.ini File in PHP Scripts?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn