Differences between php. ini-dist and php. ini-recommended (convenient development and security

Source: Internet
Author: User
After downloading php, there will be two php. ini: php. ini-dist and php. ini-recommended during configuration. what is the difference? If you select a suitable version, the security level of php. ini-recommended is higher than that of php. ini-dist. By default, display_errors is set to off, magic_quotes_gpc is set to Off, and so on. The relative php. ini-dist is the default configuration. Therefore, if you only want to perform web testing and general development, use php. ini-dist, or use php. ini-recommended.

See http://www.php.net for details

Simple description:

For local development and learning, we recommend that you copy php. ini-dist and save it as php. ini.

For security purposes, copy php. ini-recommended and save it as php. ini.

Application of PhpIniDir

PhpIniDir is the PHP initialization file. ini path. ini is stored in the windows directory. in PHP5, PHP. the ini search path is no longer limited to % SystemRoot % in the PHP4 era. PHP5 searches for PHP in the following order. ini:

1. PHPIniDir (Apache 2 module only. This command is only used when PHP is used as an Apache module and does not support CGI running PHP)
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)

In these five solutions, it is best to use PHPIniDir in combination 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 grant the read permission of PHP. ini to the server on NTFS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.