Differences between php. ini-dist and php. ini-recommended in the php source code of PhpIniDir

Source: Internet
Author: User
PhpIniDir application php source code. ini-dist and php. differences between ini-recommended and PhpIniDir applications (reproduced) PhpIniDir is the PHP initialization file php. 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. php is used in the PhpIniDir application in the php source program. ini-dist and php. ini-recommended differences
Application of PhpIniDir (reproduced)

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.
========================================================== ========================================================
Appendix: differences between php. ini-dist and php. ini-recommended

According to php. ini-dist, the difference between the two is that Php. ini-dist suitable for development programs, And Php. ini-recommended has high security settings and is suitable for product launch.. Therefore, for security and efficiency considerations, we recommend that you use php. ini-recommended as the blueprint for php. ini instead of using php. ini-dist.

Official instructions are as follows:
This is the default settings file for new PHP installations.By default, PHP installs itself with a configuration suitable for development purposes, and *NOT* for production purposes.For several security-oriented considerations that should be taken before going online with your site, please consult php.ini-recommended and http://php.net/manual/en/security.php.

Related Article

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.