Phpinidir the difference between php.ini-dist and php.ini-recommended in PHP source program

Source: Internet
Author: User
Phpinidir the difference between php.ini-dist and php.ini-recommended in PHP source program
Application of Phpinidir (reproduced)

Phpinidir is the path of PHP initialization file php.ini, in the past we put php.ini in the Windows directory, in PHP5, php.ini search path is no longer limited to PHP4 era%systemroot%, PHP5 will look for php.ini in the following order:

1, Phpinidir (Apache 2 module only, this instruction is only used when PHP as an Apache module, 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 scenarios, it is best to use Phpinidir in conjunction with Apache2, which is to include in the apache2/conf/httpd.conf file:

# Configure the path to PHP.ini
Phpinidir "c:/php"

Also, on NTFS, remember to give the server Read permission to open php.ini.
===============================================================================
Attached: The difference between php.ini-dist and php.ini-recommended

According to Php.ini-dist's instructions, the difference is that php.ini-dist suitable for development program use, while Php.ini-recommended has a high safety setting, suitable for on-line product use。 Therefore, for safety and efficiency reasons, it is recommended to use php.ini-recommended as the blueprint for php.ini rather than using php.ini-dist.

The official notes are as follows:
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 this should be taken before going online with your site, please consult PHP.I Ni-recommended and http://php.net/manual/en/security.php.

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