The php-5.2.0 configuration instruction in php.ini

Source: Internet
Author: User
Tags bitwise operators bool constant ini

Brief introduction

This article is not a simple translation of the English version of PHP.ini, but the reference to a large number of materials, combined with their own understanding,

On the basis of original php.ini, the configuration instructions of some practical modules are added, and the arrangement of file contents is adjusted.

Since the author does not like No-free's gadgets, it removes other database module configuration options except MySQL and PostgreSQL.

about php.ini;;

This file must be named ' php.ini ' and placed in the directory specified by the PHPINIDIR directive in httpd.conf.

The latest version of PHP.ini can be viewed in the following two locations:

Http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?view=co

Http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?view=co

Grammar

The syntax for this file is very simple. White-space characters and lines starting with semicolons are simply ignored.

Chapter headings (for example, [PHP]) are also simply ignored, even though they may be of some significance in the future.

The format of the directive is as follows:

directive = value

The instruction name (directive) is case-sensitive! So "Foo=bar" is different from "Foo=bar".

Values (value) can be:

1. Strings (e.g. "foo") defined in quotation marks

2. A number (integer or floating-point numbers, such as: 0, 1, 34,-1, 33.55)

3. A PHP constant (such as: E_all, M_PI)

4. An INI constant (on, off, none)

5. An expression (e.g.: E_all & ~e_notice)

INI file only uses: Bitwise operators, logical non, parentheses:

| Bit or

& Position and

~ Bit non

! Logical non

The Boolean flag is opened with on, and off is closed.

An empty string can be represented by an equal sign without writing anything, or with the None keyword:

Foo =; Set Foo to an empty string

foo = none; Set Foo to an empty string

Foo = "None"; Set Foo to string ' None '

If you use constants in a dynamic extension (PHP extension or Zend Extension) in the instruction value,

Then you can use these constants only after loading these dynamically extended command lines.

httpd.conf;;

You can also override php.ini values in httpd.conf for more flexible configuration:

Php_value name value; set a non-BOOL directive and set value to none to clear previous settings

Php_flag name On|off; only instructions for setting the bool type

PHP constants (such as E_all) can only be used in php.ini, and the corresponding mask values must be used in httpd.conf.

Directives with the "SYS" flag can only be used in the global configuration portion of the httpd.conf.

Directives with an "INI" flag cannot be used in httpd.conf, and they can only be used in php.ini.

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.