Php. ini environment configuration reference solution _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php. ini environment configuration reference solution. This article introduces php. the ini environment configuration reference solution will be helpful to many of my friends. I know that, including me, php is often used. ini is the default. today, I will refer to this article to introduce php. the ini environment configuration reference solution will be helpful to many of my friends. I know that, including me, php is often used. ini is the default one. let's take a look at this article.

The overall strategy is an exaggeration. we only discuss several configurations that will affect our general development, if you have other questions, let the server administrator do it. we are not a network administrator and don't have to worry about them. is it always necessary to make some work for them?

The code is as follows:
Extension_dir = "/path/to/php"

Directory for storing the extension Library (module), that is, the directory for PHP to find the dynamic extension module. this is usually the ext directory under the php installation directory (the file name may be somewhat different before php5 ), this directory stores a lot in PHP of windows. dll files such as php_gd2.dll and php_mysql.dll are very important to us. Modify the path according to the correct path. generally, write the absolute path, for example, d: php5ext.

The code is as follows:
Error_reporting = E_ALL &~ E_NOTICE

Set the error report Level. we recommend that you use E_ALL | E_STRICT, which includes all the errors reported by the code standard. This helps us to write standardized code at the beginning ......

Note the following for error reports:

The code is as follows:
Display_errors = On

If it is set to On, an error report is displayed. if it is set to Off, even if the error report level is set, you cannot see the error message. As a programmer, there is no more headache than knowing that the program has a problem.

The code is as follows:
Max_execution_time = 30

A single program script is allowed to occupy the maximum server time in seconds. This prevents accidental writing of an endless loop or program, which consumes the server for a long time and exhausting the server. If the value is set to 0, the running time is not limited.

The code is as follows:
Memory_limit = 16 M

Maximum memory size that can be occupied by a single script. The value-1 indicates no limit.

The code is as follows:
Max_input_time =-1

The maximum allowed time (in seconds) for a single script to parse input data (POST, GET, and upload) is set to-1, which indicates no limit.

The code is as follows:
Post_max_size = 8 M

The maximum length of bytes allowed for POST data. This setting also affects file upload. To upload a large file, the value must be greater than the value of the upload_max_filesize command.
If the memory limit is enabled, the value should be smaller than the value of the memory_limit command.

The code is as follows:
Upload_max_filesize = 2 M

The size of the files that can be uploaded. the default value is 2 MB. if you need to upload files larger than 2 MB, you must modify the values of memory_limit and post_max_size.

The code is as follows:
Upload_tmp_dir =

Temporary directory for storing files during File upload. this directory must be writable to PHP processes. if not specified, PHP uses the default temporary directory of the system.

The code is as follows:
Magic_quotes_gpc = On

Whether to use automatic string escape ('"NULL) for the input GET/POST/Cookie data, which is generally set to On. however, do not rely On this setting in the actual programming environment. Generally, you need to determine and process the data. check the code.
......

The code is as follows:

If (! Get_magic_quotes_gpc () {// determines whether the value of this parameter is On
$ Lastname = addslashes ($ _ POST ['lastname']); // not manually escaped On
} Else {
$ Lastname = $ _ POST ['lastname']; // otherwise, use
}
......

Register_globals = Off

The settings that have been deleted in PHP6 should be set to Off!

[Mbstring] module

This module is an extension of dubyte characters such as Chinese, Korean, and Japanese. The following settings are usually disabled. if you want to enable these extensions, remove the previous ";". However, these settings are a little too Personalized. we recommend that you do not set them properly. if you encounter Chinese interception or length measurement, you just need to find a program written by someone else on the Internet.

The code is as follows:
Mbstring. language = "neutral"

The default value "neutral" indicates neutral, which is equivalent to unknown. "zh-cn" or "Simplified Chinese" indicates Simplified Chinese, and "zh-tw" or "Traditional Chinese" indicates Traditional Chinese.
......
I don't want to talk about the rest. if you really need it, let's talk about it. you can contact me or go to the group number posted on the right of the homepage to ask.

Enable extended module instances

The code is as follows:

Extension = php_gd2.dll, which enables the gd library extension, which is used to generate the image

Extension = php_mysql.dll

To enable Mysql database extension, only this PHP can be connected to the Mysql database. remove the semicolon before the two rows (or directly add these two rows to the ini settings ), it indicates that it is enabled.

...

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.