Home Backend Development PHP Tutorial php.ini configuration detailed options_PHP tutorial

php.ini configuration detailed options_PHP tutorial

Jul 15, 2016 pm 01:23 PM
php php.ini start up exist yes detailed read Options Configuration Configuration file

php.ini 或 php3.ini 是 PHP 在启动时会读取的配置文件。该文件的存放路径为 /usr/local/lib/。在 PHP 3.x 版的配置文件为 php3.ini;而在 PHP 4.x 版改为 php.ini。若 PHP 安装成服务器的模块,则在 Web 服务器启动执行时会读取,之后就不再读取,因此改动配置的话要重新启动 Web 服务器。若使用独立 PHP CGI 方式,则每次都读一次。

要看目前的系统配置,可以用phpinfo()看到。以下为选项配置

php_value name value 配置变量名称和值。本选项需 PHP 4.x 版之后才能使用。

php_flag name on|off 配置标志布尔变量选项。本选项需 PHP 4.x 版之后才能使用。

php_admin_value name value 配置 Apache 的配置文件变量。原来在 .htaccess 的配置改到这个选项配置。本选项需 PHP 4.x 版之后才能使用。

php_admin_flag name on|off 配置布尔变量当标志。本选项需 PHP 4.x 版之后才能使用。

asp_tags boolean 配置 PHP 程序是否解析以 ASP Script 语法 的标记 (tag)。本选项在 PHP 3.0.4 之后才可使用。更多的细节可以参考>嵌入方法的部份。

auto_append_file string 配置本选项可以让指定的文件附加在原 PHP 程序后面自动执行。若 PHP 程序中有用到 exit() 函数,则指定的文件不会执行。参数 string 即为指定自动执行的文件。

auto_prepend_file string 配置本选项可以让指定的文件在原 PHP 程序之前自动执行。参数 string 即为指定自动执行的文件。

cgi_ext string 本选项配置 CGI 程序的扩展名。

display_errors boolean 本选项配置是否要将执行的错误信息显示在用户的浏览器上。

doc_root string 配置服务器的文件及 PHP 文件放置的根目录。

engine boolean 本选项需要使用apache的模块方式使用 PHP。可配置是否要使用 PHP 引擎。在 httpd.conf 中加入 php3_engine on/off 亦可配置某目录或某虚拟网站是否要用 PHP 解析器。

error_log string 本选项用来配置错误记录文件。在 UNIX 系统上参数 string 即为文件名。Windows NT 会将记录记在事件检视器的日志之中。Windows 95/98 则不支持系统记录。

error_reporting integer 本选项用来配置系统记录的等级。参数 integer 即为等级的级数标志,可以加在一起,默认值为 7,见下表
 
级数 说明
1 一般的错误
2 一般的警告
4 解析错误
8 非关键的警告

open_basedir string This option is used to configure the lowest-level directory that provides PHP access. PHP programs can only access files or directories under the specified directory. Using this option is mainly for system security considerations. The parameter string is the lowest directory node to be restricted. It is worth noting that in UNIX systems, if the files or directories under the node have symbolic links, the purpose of using this option may be compromised. Therefore, it is also important for Webmaster to consider the design of the directory. Task. The default value is that all files are accessible. After PHP version 3.0.7, multiple underlying directories can be configured.

gpc_order string Configure the order and rules of GET/POST/COOKIE three modules. The parameter string is the rule to be configured. For example: configuring it as "GP" means ignoring cookies and replacing GET with POST when the access method (method) is the same.

ignore_user_abort string The default value is Off. Used to configure whether to continue processing when the client is disconnected when the transmission is not completed.

include_path string is the file search path for functions such as require, include, and fopen_with_path in PHP programs. The direction of the slash is different in UNIX or Windows.

log_errors boolean specifies whether program errors should be recorded in the log file.

magic_quotes_gpc boolean configures the special characters of the three modules of GET/POST/COOKIE, including single quotes, double quotes, backslashes, and null characters (NUL). Whether to automatically Add a backslash when overflowing characters.

magic_quotes_runtime boolean configures whether to automatically add backslashes to the returned data when overflowing characters occur.

magic_quotes_sybase boolean configures single quotes in sybase data to automatically add backslashes as overflow characters.

max_execution_time integer configures the maximum execution time of the program. The unit is seconds.

memory_limit integer configures the maximum amount of memory used by the program.

short_open_tag boolean Configures whether to use short PHP tags ( ?>). If you do not use it, you must use

track_errors boolean Turning on this option allows the final error message to be followed by the global variable $php_errormsg.

track_vars boolean Turning on this option allows the string entered by the user to be automatically parsed into variables without having to handle it yourself.

upload_tmp_dir string specifies the temporary path of the uploaded file.

user_dir string specifies the path to the user's root directory.

warn_plus_overloading boolean If this option is turned on, strings can only be linked with English periods (.), but not with plus signs (+).

SMTP string In Windows series operating systems, it is used to specify the SMTP server for use by the mail function. The parameter string is the SMTP server name.

sendmail_from string configures the "From: " string for the mail function used by Windows series operating systems.

sendmail_path string configures the placement path of the sendmail program. For example /usr/sbin/sendmail.

safe_mode boolean Configures PHP to execute in safe mode.

safe_mode_exec_dir string Configure the path for safe mode program execution.

debugger.host string specifies the remote debugging server name, which can be IP or Domain Name.

debugger.port string Configure the port of the remote debugging server.

debugger.enabled boolean configures whether the debug mode can be used.

enable_dl boolean This option is only valid when using the Apache module. Whether functions used to configure PHP work. When the system is in safe-mode, this option enable cannot use the dl() function.

extension_dir string Configure the path of the dynamic function.

extension string The dynamic extension function to be loaded when PHP starts.

mysql.allow_persistent boolean configures whether to allow persistent connections to the MySQL database, which will affect the function.

mysql.max_persistent integer Configures each handler to maintain up to several MySQL persistent connections.

mysql.max_links integer Configure each handler to open up to several MySQL connections, including persistent connections.

msql.allow_persistent boolean configures whether to allow persistent connections to the mSQL database, which will affect the function.

msql.max_persistent integer Configures each handler to maintain up to several mSQL persistent connections.

msql.max_links integer Configure each handler to open up to several mSQL connections, including persistent connections.

pgsql.allow_persistent boolean configures whether to allow persistent connections to the Postgres database, which will affect the function.

pgsql.max_persistent integer Configures each handler to maintain up to several Postgres persistent connections.

pgsql.max_links integer Configures the maximum number of Postgres connections each handler can open, including persistent connections.

sybase.allow_persistent boolean configures whether to allow persistent connections to the Sybase database (persistent connections), which will affect the function.

sybase.max_persistent integer Configures each handler to maintain a maximum of several Sybase persistent connections.

sybase.max_links integer
Configure each handler to open up to several Sybase connections, including persistent connections.

sybct.allow_persistent boolean configures whether to allow persistent connections to the Sybase-CT database. The default value is open.

sybct.max_persistent integer Configures a maximum of several Sybase-CT persistent connections to be maintained per handler. The default value is -1 for no limit.

sybct.max_links integer Configures the maximum number of Sybase-CT connections each handler can open, including persistent connections. The default value is -1, which means no limit.

sybct.min_server_severity integer Configure the minimum number of Sybase-CT server error reports. The default value is 10.

sybct.min_client_severity integer Configure the minimum number of Sybase-CT client error reports. The default value is 10.

sybct.login_timeout integer Configure the longest login time that Sybase-CT can use. The default value is 1 minute.

sybct.timeout integer Configures the query operation time limit of Sybase-CT. The default value is unlimited.

sybct.hostname string Configures the machine name to which Sybase-CT can connect. The default value is unlimited

ifx.allow_persistent boolean configures whether to allow Informix database persistent connections (persistent connections), which will affect the function.

ifx.max_persistent integer Configures each handler to maintain up to several Informix persistent connections.

ifx.max_links integer Configure each handler to open up to several Informix connections, including persistent connections.

ifx.default_host string configures the server name of Informix's default connection for use by the ifx_connect() or ifx_pconnect() function.

ifx.default_user string configures the user account for Informix's default connection, for use by ifx_connect() or ifx_pconnect( function.

ifx.default_password string Configure the user password for Informix default connection, used by ifx_connect() or ifx_pconnect() function

ifx.blobinfile boolean Configure Informix long bit class mode. , 0 table is in memory; 1 table is in file. You can also use the ifx_blobinfile_mode() function in the PHP program to modify it.

ifx.textasvarchar boolean configures the Informix text mode by default. Value, 0 means return blob code; 1 means return varchar string. You can also use ifx_textasvarchar() function in PHP program to modify the configuration.

ifx.byteasvarchar boolean. Configure the default value of the Informix bit group mode. 0 means returning the blob code; 1 means returning the varchar string. You can also use ifx_byteasvarchar() in the PHP program to modify the configuration. >ifx.charasvarchar boolean configures whether the trailing spaces in the string returned by Informix should be automatically removed

ifx.nullformat boolean configures the return method of the NULL field, true means returning a string. NULL, false table returns the string "". You can also use ifx_nullformat() to modify the decimal point of the BC high-precision function library in the PHP program.

browscap string Configure the browser’s file opening capability name.

uodbc.default_db string Configure ODBC. The database name of the default connection, used by the odbc_connect() or odbc_pconnect() function. () function is used.

uodbc.default_pw string Configure the user password for the ODBC default connection, for use by odbc_connect() or functions.

uodbc.allow_persistent boolean configures whether to allow persistent connections to the ODBC database (persistent connections), which will affect the odbc_pconnect() function.

uodbc.max_persistent integer Configures each handler to maintain up to a few ODBC persistent connections.

uodbc.max_links integer Configures the maximum number of ODBC connections each handler can open, including persistent connections.

The following configuration values ​​related to session are only supported in PHP 4.x and above. In the php.ini configuration file.

session.save_handler defines the file name of session storage data. The default value is files.

session.save_path defines the file path where the session stores data. The default value is /tmp.

session.name configures the cookie name used by the session. The default value is PHPSESSID.

session.auto_start configures whether the session is automatically opened. The default value is 0 (no).

session.lifetime configures the storage time of the cookie after it is sent to the browser, in seconds.The default value is 0, which means until the browser is closed.

session.serialize_handler defines the header of continuous/de-continuous data. This function is only used internally by the WDDX module or PHP. The default value is php.

session.gc_probability configures the garbage collection (gc, garbage collection) processing probability for each request response. The default value is 1.

session.gc_maxlifetime configures the number of seconds to live before waste is cleared.

session.extern_referer_check determines whether the Session code referring to the client should be deleted. Sometimes it is configured not to be deleted due to security or other considerations. The default value is 0.

session.entropy_file configures the session code to be created using an external high-entropy resource or file, such as /dev/random or /dev/urandom on UNIX systems.

session.entropy_length configures the number of bytes the session reads from high-entropy resources. The default value is 0.

session.use_cookies configures whether the session should be turned into a cookie and stored on the client side. The default value is 1, which means this function is turned on.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446858.htmlTechArticlephp.ini or php3.ini is the configuration file that PHP will read when it starts. The storage path of this file is /usr/local/lib/. In PHP 3.x version, the configuration file is php3.ini; in PHP 4.x version, it is changed to...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles