PHP. INI configuration file travel

Source: Internet
Author: User
Before you start to browse the PHP configuration file, it is worth noting that the internal structure of the PHP configuration file. This file is called php. ini, which has the same structure as the ini file widely used in many Windows application programs. Php. ini is an ASCLL text

PHP configuration file

Before you start to browse the PHP configuration file, it is worth noting the internal structure of the PHP configuration file. This file is called php. ini, which has the same structure as the ini file widely used in many Windows application programs. Php. ini is an ASCLL text file, which is divided into multiple parts, each part contains coherent parameters, as shown below:

[MySection]
Variable = 'value'
Anothervariable = 'anothervalue

The name of each part is placed in square brackets at the beginning, followed by the name pair number, each name pair occupies a unique row. Due to the regular PHP code, the parameter name is very sensitive and cannot contain spaces. However, the parameter value can be a number, string, or Boolean logical number.

The semicolon is located at the beginning of each row and serves as the specified mark. This makes it easy to apply or not apply these features of PHP, without deleting the row. you can annotate it without compiling it. If you want to apply this feature again in the database in the future, this is very convenient and you do not need to delete it from the file.

PHP. the INI file must be placed in the current directory, which is defined in the $ PHPRC environment parameter or the directory specified during the compilation time (for Windows PHP, it is an important Windows directory ).

After changing the php pattern through the PHP. ini file, you will need to restart the Web server for your change to take effect (of course, this is assumed that you are applying PHP through the Web server ). For the command line of the application of PHP, the configuration file will be read once every time a PHP binary program is imported.

  Set parser options

In this process, the first step is the most important step, that is, the option related to the language description program. The important option here is the engine parameter, which controls the PHP Server as "On" or "Off ". The PHP code embedded in the closed server is not parsed by the Web server. However, the server is usually "On.

Engine = On

  Short_open_tagParameter control whether the syntax analyzer recognizes shortcuts , Similar to the identification scale key . If this parameter conflicts with other languages, or if you want to apply strict syntax rules in PHP code, the parameter will be closed.

Short_open_tag = On

Generally, Cookie or HTTP data must be sent before any program generates output. If you cannot implement this in a program, you can use the output_buffering parameter of the application to make PHP call the output buffer take effect.

When the output buffer is in the "On" status, PHP stores the program output in a dedicated memory buffer and sends it within the specified time range. This promises that you will send special HIIP titles and important data when writing the program or when it is about to end, but it will also gain some important benefits.

Output_buffering = Off

You can also specify the buffer size through the output_buffering parameter value, for example:

Output_buffering = 2048

When PHP is started, it adds information about the version number to the scale title box of the Web server. To disable this feature, set expose_php to false. This is very useful. for example, you can prevent hackers from hiding your webpage server capacity.

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.