Differences between php. ini-dist and php. ini-recommended

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? What should I do if I select a suitable version?

After downloading php, there will be two php. ini: php. ini-dist and php. ini-recommended during configuration. What is the difference? What should I do if I select a suitable version?

Php. ini-recommended has a higher security level than 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.

For more information, see

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. 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.