PHP configuration file in a detailed

Source: Internet
Author: User
Tags ibase interbase mssql session id php error sybase system log tidy

When optimizing PHP performance, this is the first to optimize the configuration file. Below to share with you my summary of the php.ini configuration file in the explanation of each line, I hope to help you learn more about PHP.

[[Email protected] ~]# grep-v ";"/etc/php5/apache2/php.ini[php]engine = on---> Whether the PHP parsing engine is enabled Short_open_tag = Off---> Whether to use the introduction flag ASP_ tags = Off---> Do not allow ASP class flags precision =---> Floating-point data display validity y2k_compliance = on---> Forced open2000 accomodation (may cause problems in non-Y2K adapted browsers). Output_buffering =4096---> Output buffer size (bytes). Recommended value is4096~8192. Zlib.output_compression = Off---> Whether to turn on zlib output compression Implicit_flush = off---> whether the PHP output layer is required to automatically refresh the data after each output block is equivalent to eachPrint (),The flush () function is automatically called after the Echo (), HTML block. Opening this option has a serious impact on the performance of the program, and is usually recommended for debugging purposes only. In the execution mode of the CLI SAPI, the directive defaults to on. Unserialize_callback_func =serialize_precision =17# # # #将浮点型和双精度型数据序列化存储时的精度 (number of significant digits). The default value ensures that floating-point data is not lost when it is decoded by the deserialization program. Allow_call_time_pass_reference = Off# # # #是否强迫在函数调用时按引用传递参数 (you will receive a warning each time you use this attribute).; PHP opposes this practice and is no longer supported in future versions because it affects the cleanliness of the code. The encouragement method is to explicitly specify which parameters are passed by reference in the function declaration. We encourage you to turn off this option to ensure that your scripts will still work correctly in future versions of the language. Safe_mode = Off---> Safe Mode safe_mode_gid = Offsafe_mode_include_dir =#在安全模式下, the Uid/gid check is skipped when the files in the group directory and its subdirectories are included. In other words, if the value here is empty, any files that are not compliant with the Uid/gid are not allowed to be included. The directory set here must already exist in the Include_path directive or be included with the full path. Multiple directories are separated by a colon (win under a semicolon). The specified limit is actually a prefix, not a directory name. Safe_mode_Exec_dir = executable file directory in---> Safe mode safe_mode_allowed_env_vars = Php_# # # #在安全模式下, the user can only change the prefix list of environment variables (comma delimited). Allowing users to set certain environment variables can lead to potential security vulnerabilities. Note: If this parameter value is NULL, PHP will allow the user to change any environment variable. Safe_mode_protected_env_vars = Ld_library_path# # # #在安全模式下, the user cannot change the list of environment variables (comma delimited). These variables will be protected even if the safe_mode_allowed_env_vars instruction is set to allow.Disable_functions =---> the directive accepts a comma-delimited list of function names to disable a specific function.Disable_classes =---> the directive accepts a comma-delimited list of class names to disable a particular class zend.enable_gc = on--→expose_php = on---> Displays PHP information at the head of the Web page max_ Execution_time =---> Maximum execution seconds per script max_input_time =---> Each script is used to analyze the maximum limit time for request data Memory_Limit =128M---> Memory limit performed per script error_reporting = e_all & ~e_deprecateddisplay_errors = Off--->#显示失误 (the turn off, change to log display) Display_startup_errors = off--->#显示启动失误Log_errors = on---> Generate error error log displayLog_errors_max_len =1024x768---> Set error_Log Maximum length ignore_repeated_errors = Off---> does not log duplicate information after it is opened Ignore_repeated_Source = off---> Ignore source when repeating information is logged Report_memleaks = on---> Report memory leak, only valid in debug compilation mode track_errors = Off---># # # #在 Save the last Error/warning message (logical value) in the _errormsg $php. Never again use this attribute in a production environment: Html_errors will display the HTML tag where PHP error html_errors = Off---> Whether to turn on static Web page Error Variables_order ="GPCs"---># # # #此指令描述了PHP注册GET, POST, Cookie, environment and sequence of built-in variables (each using G, P, C, E and S, generally using egpcs or GPC). Registration uses a left-to-right order, and the new value overwrites the old value. Request_order ="GP"# # # #此指令描述的顺序PHP注册GET, post and cookie variable _request array. The registration is left to right, and the new value overwrites the old value. If this directive is not set, the $_request content is used in Variables_order. Please note that the default assigned php.ini file does not contain ' C ' cookies for security reasons. Register_globals = OFF---># #是否打开register全局变量register_long_arrays = Off# # # #是否注册老形式的输入数组, http_get_vars and related arrays; If you do not use them, it is recommended to turn them off in order to improve performance. REGISTER_ARGC_ARGV = Off# # # #此指令让PHP确认是否申明 ARGV&AMP;ARGC variables (These variables will contain get information). If you do not use these variables, you should turn off this option in order to improve performance. Auto_globals_jit = On# # # #当打开此项, the SERVER and ENV variables will be created the first time they are used or not at the beginning of the script (runtime); If these variables are not used in the script, opening this item adds a bit of performance.; In order for this directive to be valid, PHP commands register_globals, register_long_arrays, and register_argc_argv must be closed. Post_max_size =8M--->#PHP可以接受的最大的POST数据大小magic_quotes_gpc = OFF--->#针对GET/post/cookie Data Open Magic Quotes.magic_quotes_runtime = Off# # # #针对实时产生的数据打开Magic quotes, such as data obtained from SQL, data returned from exec (), and so on. Magic_quotes_sybase = Off# #使用 Sybase-style magic quotes (using "to boot ' overrides \ '). Auto_prepend_file =--->#在任何PHP文档之前或之后自动增加文件auto_append_file =# # # #两个有趣的变量是auto_prepend_file以及auto_append_file. These variables specify that PHP automatically adds other files to the header or end of the file in any PHP document. This is useful for adding a header or footer to a page generated by PHP, saving you time for adding code to each PHP document. Note, however, that the specified files here will be added to all PHP documents, so these variables must be appropriate for a single application (single-application) server. The included files are either PHP scripts or plain HTML documents. Embedded PHP code must use standard &AMP;LT; Php...? &gt; tag. Default_mimetype ="Text/html"--->#PHP内建默认为text/htmldoc_root =--->#PHP的 "root directory". Valid only when not empty.; If safe_mode=on, files outside this directory are rejected.; If PHP is compiled without specifying Force_redirect, and is run as CGI on non-IIS servers; You must set this directive (see the Security Section in the manual).; The alternative is to use the cgi.force_redirect directive User_dir =# # # #告诉php在使用/~username to the directory when the script is opened, only valid when not empty. That is, the basic directory name of the PHP file under the user directory, for example: "Public_html"ENABLE_DL = Off# # # #是否允许使用dl () function. The DL () function is only valid if PHP is installed as an Apache module. Disabling the DL () function is primarily for security reasons because it bypasses the limits of the OPEN_BASEDIR directive. The DL () function is always disabled in safe mode, regardless of how it is set here. File_uploads = on---> whether the upload function is enabled upload_max_filesize =2M--->#最大可上传文件, 2mmax_file_uploads =---> Maximum simultaneous upload20 Files Allow_url_fopen = on--->#是否允许打开远程文件allow_url_include = OFF--->#是否允许include/require Remote File Default_socket_timeout =---> Default socket time-out [date]---> Date [filter][iconv][intl][sqlite][sqlite3][pcre][pDo][pDo_mysql]pdo_mysql.cache_size =$---> ped_mysql cache size pdo_mysql.default_socket=---> Default socket time [phar][syslog]define_syslog_variables = Off- --Define various system log variables [mailFunction]---> mail function smtp = localhost---> local as mail server Smtp_port =25 Message port number default is25mail.add_x_header = on---> whether the maximum Header[sql]sql.safe_mode = Off is turned on# # # #是否使用SQL安全模式. If you open, the database connection function that specifies the default value will use these default values instead of the supported parameters. For each connection function for a different database, refer to the corresponding manual page for the default values. [odbc]odbc.allow_persistent = on---> Allow or block persistent connections. Odbc.check_persistent = on---> Check that the connection is available before reuse odbc.max_persistent = -1---> Maximum number of persistent connections,-1 means there is no limit. Odbc.max_links =-1---> Maximum number of connections (persistent + non-persistent).-1 means there is no limit. ODBC.DEFAULTLRL =4096---> Long field processing. Returns the number of bytes of a variable.0 means skipping over. Odbc.defaultbinmode =1# # # #二进制数据处理. 0 means skip over, 1 follow the actual return, 2 convert to character.; View Odbc_binmode and Odbc_longreadlen documentation for explanations of UODBC.DEFAULTLRL and Uodbc.defaultbinmode [Interbase]---> InterBase Database ibase.allow_persistent =1--→ allow or organize persistent connections. Ibase.max_persistent =-1---> Maximum number of persistent connections,-1 means there is no limit. Ibase.max_links =-1---> Maximum number of connections (persistent + non-persistent).-1 means there is no limit. Ibase.timestampformat ="%y-%m-%d%h:%m:%s"---> Database time record mode Ibase.dateformat ="%y-%m-%d" Ibase.timeformat ="%h:%m:%s" [Mysql]mysql.allow_Local_infile = on---> Whether local files are allowed to connect to the database Mysql.allow_persistent = on---> Allow or disallow persistent connections Mysql.cache_size =---> mysql cache size mysql.max_persistent =-1---> Maximum number of persistent connections. -1 means there is no limit. Mysql.max_links =-1---> Maximum number of connections (persistent and non-persistent). -1 stands for unrestricted Mysql.default_port =# # # #mysql_connect () Use the default port, if not set, mysql_connect (); the variable will be used$MYSQL _tcp_port, or mysql-tcp entry under/etc/services (Unix), or in the compilation is defined Mysql_port (in this order); WIn32 environment, only mysql_port will be checked. Mysql.default_socket =# # # #用于本地 The default socket name for MYSQL connection. NULL, use MYSQL built-in value Mysql.default_host =---> mysql_connect () Default host used (invalid in safe mode) Mysql.default_user =---> mysql_connect ( Default user name (invalid in safe mode) Mysql.default_password =---> mysql_connect () default password used (invalid mysql.connect_timeout in safe mode =---> Connection time-out, default is60smysql.trace_mode = Off[mysqli]mysqli.max_persistent =-1---> Maximum number of persistent connections. -1 means there is no limit. Mysqli.allow_persistent = on---> Allow or deny long connection Mysqli.max_links =-1---> Maximum number of connections. -1 means there is no limit. Mysqli.cache_size =---> Connection cache size Mysqli.default_port =3306---> Connection port number# # # #mysqli_connect () The default port number. If not set, mysql_connect () uses $MYSQL _tcp_port, or MySQL that is defined at the MYSQL-TCP portal at/etc/services or at compile time The _port value (found in this order).; Win32 will only look for mysql_port values. Mysqli.default_socket =# # # #对于本地MySQL连接的默认socket名称. If empty, the MySQL built-in default value is used. Mysqli.default_host =# # # #mysqli_connect () Default host value (does not take effect in safe mode) Mysqli.default_user =# # # #mysqli_connect () The Default user value (will not take effect in safe mode). MYSQLI.DEFAULT_PW =# # # #mysqli_connect () default password value (not valid in Safe mode).; Note Saving passwords in this file is generally a bad * doctrine.; * Any user who uses PHP can performEcho Get_cfg_var ("Mysqli.default_password"); And get to this password! And, of course, anyone who has read access to this file can get this password. Mysqli.reconnect = Off---> Allow or block persistent connections [Mysqlnd]mysqlnd.collect_statistics = Onmysqlnd.collect_memory_statistics = Off[oci8][postgresql]pgsql.allow_persistent = on---> Allow or block persistent connections. pgsql.auto_ Reset_persistent = Off# # # #总是在 Pg_pconnect () detects a disconnected persistent connection.; The automatic reset feature can cause a little overhead. Pgsql.max_persistent =-1---> Maximum number of persistent connections. -1 means there is no limit. Pgsql.max_links =-1---> Maximum number of connections (persistent + non-persistent). -1 means there is no limit to Pgsql.ignore_notice =0---> Whether to ignore the PostgreSQL backend notification message.; A little overhead is required to advertise a message record. Pgsql.log_notice =0# # # #是否记录 PostgreSQL backend notification message.; The module cannot log the advertisement message unless pgsql.ignore_notice=0. [sybase-ct]sybct.allow_persistent = on---> Allow or block persistent connections. Sybct.max_persistent =-1---> Maximum number of persistent connections. -1 means there is no limit. Sybct.max_links =-1---> Maximum number of connections (persistent + non-persistent). -1 means there is no limit. sybct.min_server_severity =---> shows the minimum severity of errors. sybct.min_client_severity =---> shows the minimum severity of the message [Bcmath]bcmath.scale =0--->#用于所有bcmath函数的10十进制数数字的个数 [browscap][session] Session.save_handler = Files---> control method for saving/retrieving data session.use_cookies =1---> whether to use Cookiessession.use_only_cookies =1# # # #这个选项允许管理员去保护那些在URL中传送session ID users are exempt from attack; default is 0.session.name = PHPSESSID---> Session Name (also as the name of the cookie Session.auto_start =0--→ Initialize Sessionsession.cookie_lifetime at the start of the request =0---> The number of seconds that a cookie is alive, if0, it is until the browser restarts Session.cookie_path =/---> The valid path of the cookie Session.cookie_domain = valid domain name for---> Cookie session.cookie_ HttpOnly =# # # #是否将httpOnly标志增加到cookie上, the added cookie cannot be accessed by the browser's scripting language (for example, JavaScript). Session.serialize_handler = PHP is used to serialize the data of the processor. PHP is the standard PHP serializer. session.gc_probability =1####; Defines the scale at which the garbage collection process starts at each session initialization.; The proportions are derived from gc_probability/gc_divisor; For example.1/100 means that at each request there is1% chance to startThe ' garbage collection ' process. Session.gc_divisor =1000session.gc_maxlifetime =1440# # # #在这里数字所指的秒数后, the saved data will be treated as ' fragments ' (garbage) and cleaned up by the GC process. session.bug_compat_42 = Off# # # #PHP 4.2 and earlier have an undisclosed feature/bug, this feature allows you to initialize a session variable globally, even if Register_globals has been closed.; If this feature is used, PHP 4.3 and earlier versions will warn you.; You can turn off this attribute and isolate this warning. At this point, if bug_compat_42 is turned on, the warning is only shown. Session.bug_compat_warn = Offsession.referer_check =# # # #检查HTTP Referer to prevent external URLs with IDs.; Http_referer must contain this field from the session to be considered legitimate. Session.entropy_length =0---> How many bytes are read from this file Session.cache_limiter = NoCache# # # #设置为 {nocache,private,public,} to determine the type of HTTP buffer, leaving blank prevents the anti-caching header from being sent. Session.cache_expire =The---> Documents expire after n minutes. Session.use_trans_sid =0# # # #trans SID support is off by default.; Using the trans Sid may give your users a security risk.; Care must be taken to use this item. -The user may send a URL containing a valid session ID to others by email/irc/other means.; -URLs containing valid session IDs may be stored on computers that are easily accessible to public access.; -Users may access your site through a URL that contains the same session ID in the browser history or in the Favorites folder. Session.hash_function =0---> Selectionhash method;0:MD5 ((BITS);1:sha-1 (BITS) Session.hash_bits_per_character =5; When converting a binaryWhen the hash data is in the readable form, there are several characters each word.4 bits:0-9, a-F;5 bits:0-9, A-v;6 bits:0-9, A-Z, A-Z,"-","," url_rewriter.tags =The "A=href,area=href,frame=src,input=src,form=fakeentry" url rewriter finds the URL within a set of HTML tags already defined. Form/fieldset is a special character; If you include them here, Rewriter will add a hidden <input> field that contains the information, otherwise it is appended with the information in the URL.; If you want to comply with XHTML, delete the entry for the form.; Note that all legal entrances require aThe "=" symbol, even without any value. [mssql]mssql.allow_persistent = on---> Allow or block persistent connection mssql.max_persistent =-1---> Maximum number of persistent connections. -1 means there is no limit. Mssql.max_links =-1---> Maximum number of connections (persistent + non-persistent). -1 means there is no limit. mssql.min_error_severity =---> shows the minimum severity of the error. mssql.min_message_severity = ---> shows the minimum severity of the message Mssql.compatability_mode = OFF---& Gt PHP 3.0 older version of compatibility mode. Mssql.secure_connection = OFF---> Use NT Authentication when connecting to the server [Assertion][com][mbstring][gd][exif][tidy] # # # #当调用tidy时, default to the path to the tidy configuration file tidy automatically clean and repair the output?; Warning: Do not use this when you produce non-HTML content, such as when a dynamic picture is generated tidy.clean_output = Off whether the erase function is turned on, In this article, the Shutdown state [soap]soap.wsdl_cache_enabled=1---> Turns the WSDL buffering feature on or off. soap.wsdl_cache_dir="/tmp"---> Sets the directory where the SOAP extension holds the buffer file soap.wsdl_cache_ttl=86400---> (Time-to-live) sets the number of seconds the buffer file is used to replace the original buffer file soap.wsdl_cache_limit =  5---> min cache [sysvshm][ldap]ldap.max_links =-1[mcrypt][dba][xsl]        

PHP configuration file in a detailed

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.