Home > Backend Development > PHP Tutorial > Introduction to the difference between php.ini-dist and php.ini-recommended (convenient for development and security friends)_PHP Tutorial

Introduction to the difference between php.ini-dist and php.ini-recommended (convenient for development and security friends)_PHP Tutorial

WBOY
Release: 2016-07-21 15:17:19
Original
828 people have browsed it

php.ini-recommended has a higher security level than php.ini-dist. The default is to set display_errors to off, magic_quotes_gpc to Off, etc. The corresponding php.ini-dist is the default configuration. So, if you just want to do web testing and general development, use php.ini-dist, otherwise use php.ini-recommended.

For details, please refer to http://www.php.net

Simple explanation:

If you are developing and learning locally, it is recommended to copy php.ini-dist and save it as php .ini

If it is used on the server, for safety, copy php.ini-recommended and save it as php.ini

Application of PhpIniDir

PhpIniDir is the path to PHP's initialization file php.ini. In the past, everyone placed php.ini in the windows directory. In PHP5, the search path for PHP.ini is no longer limited to %SystemRoot% in the PHP4 era. PHP5 will follow the following order Find PHP.ini:

1. PHPIniDir (Apache 2 module only, this command is only used when PHP is used as an Apache module, and does not support PHP running CGI)
2. Registry key value: HKEY_LOCAL_MACHINE/SOFTWARE/PHP/IniFilePath
3. Environment variable: %PHPRC%
4. PHP5 directory (for CLI), or web server directory (for SAPI modules)
5. Windows directory (C: /windows or C:/winnt)

Among these five solutions, it is best to use PHPiniDir when working with Apache2, that is, add the following to the apache2/conf/httpd.conf file:

# configure the path to php.ini
PHPIniDir " C:/php"

In addition, remember to give the server read permission for PHP.ini on NTFS.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325710.htmlTechArticlephp.ini-recommended has a higher security level than php.ini-dist. The default is to set display_errors to off, magic_quotes_gpc to Off, etc. The corresponding php.ini-dist is the default configuration...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template