php.ini dist and php.ini recommended introduce the difference between of for easy development and safe friends

  • 2020-05-19 04:17:53
  • OfStack

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

Specific see http: / / www. php. net

Simple instructions:

For local development learning, it is recommended to copy php.ini-dist1 and save it as php.ini

If used on a server, copy php.ini-recommended1 and save it as php.ini for security

The application of PhpIniDir

PhpIniDir is the path of the initialization file php.ini of PHP. In the past, php.ini was placed in the windows directory.

1. PHPIniDir (Apache 2 module only, this directive is only used when PHP is used as Apache module, PHP running CGI is not supported)
2, registry keys: 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)

The five scenarios, with best to use PHPIniDir Apache2, namely in apache2 / conf/httpd conf file to add:

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

Also, on NTFS, remember to give the server read permissions on PHP.ini.


Related articles: