SoFunction
Updated on 2025-04-09

Highly recommended: Chinese version (1)


[PHP]
; PHP is also a constantly evolving tool, and its functions are constantly being deleted
; and the settings change can reflect considerable changes,
; Before using the new PHP version, it will be beneficial

;;;;;;;;;;;;;;;;;;;
; About this document ;


; This file controls many aspects of PHP perspectives. In order for PHP to read this file, it must be named
; ''. PHP will look for the file in these places: the current working directory; the environment variable PHPRC
; Specified path; path specified at compile time.
; Under Windows, the path at compile time is the Windows installation directory.
; In command line mode, the search path can be replaced by the -c parameter.

;The syntax of this file is very simple. Whitespace characters and lines starting with semicolons ';' are simply ignored (as you might
; guessed the same). Chapter titles (e.g. : [Foo]) are also simply ignored, even if they may
; It has some meaning.

; Indicates that the following syntax is specified:
; Indicator Identifier = Value
; directive = value
; Indicator identifier is *case sensitive* - foo=bar Different from FOO = bar.

; The value can be a string, a number, a PHP constant (such as: E_ALL or M_PI), the INI constant
;On, Off, True, False, Yes, No and None) or an expression
; (such as: E_ALL & ~E_NOTICE), or a string ("foo") enclosed in quotes.

; Expressions of INI files are limited to bit operators and brackets.
; | bitwise OR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT

; Boolean flags can be placed in the on state with 1, On, True or Yes.
; They can be placed in the off state with 0, Off, False or No.

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

; foo = ; Set foo to an empty string
; foo = none ; set foo to empty string
; foo = "none" ; set foo to the string 'none'

; If you use constants in value settings, and these constants belong to dynamically call-in extension libraries (either PHP extensions, or
; Zend extension), you can only use these constants if you click on the rows of these extensions*after*.

; All values ​​set in the -dist file are the same as the built-in default value (this means, if
; Not used or you deleted these lines, the default value is the same as it).



; Language options ;


engine = On
; Make PHP scripting language engine effective under Apache.
short_open_tag = On
; Allow <? mark (this simple representation). Otherwise only <?php and <script> tags will be recognized.
asp_tags = Off
; Allow ASP-style <% %> tags
precision = 14
; Number of significant digits when displaying floating point type number

y2k_compliance = Off
; Whether to open 2000 adaptation (may cause problems in non-Y2K adaptation browsers)

output_buffering = Off
; Output cache allows you to send header (header, including cookies) lines even after outputting the body content
; The cost is that the output layer slows down a little bit. You can use the output cache to open the output cache when running.
; Or set the indication to On here to enable the output cache of all files to be opened.
output_handler = ; You can redirect all outputs of your script to a function,
; Doing that may be useful for processing or logging it.
; For example, if you set this output_handler to "ob_gzhandler",
; Then the output will be transparently compressed for browsers that support gzip or deflate encoding.
; Suppose an output processor automatically turns on the output buffer.

implicit_flush = Off
; Force flush (refresh) to let PHP tell the output layer to automatically refresh its own data after each output block.
; This is equivalent to calling the flush() function after each print() or echo() call and each HTML block.
; Turning on this setting will cause serious runtime conflicts, and it is recommended to turn it on only during debugging.

allow_call_time_pass_reference = On
; Whether to force function calls to pass parameters by reference. This method was protested.
; and may no longer be supported in future versions of PHP/Zend.
; The method of specifying which parameters are passed by reference is encouraged in the function declaration.
; You are encouraged to try turning off this option and confirm that your script is still working properly to ensure that it is in future versions of the language
; They still work. (You will get a warning every time you use the feature, and the parameters will be by value instead of by reference
; pass).

; Safe Mode Safe Mode
safe_mode = Off
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
; ?Setting certain environment variables
; ?may be a potential security breach.
; This indication contains a comma-separated list of prefixes. In safe mode, users can only replace
; The value of the environment variable starting with the prefix listed here.
; By default, users will only be able to set environment variables starting with PHP_ (such as: PHP_FOO=BAR).
; Note: If this indication is empty, PHP will let the user change any environment variables!

safe_mode_protected_env_vars = LD_LIBRARY_PATH
; This indication contains a comma-separated list of environment variables that end users will not be able to change with putenv ().
; These variables are even protected with safe_mode_allowed_env_vars set to allow.

disable_functions =
; This instruction allows you to invalidate a specific function for security reasons.
; It accepts a comma-separated list of function names.
; This indication *is not affected by whether the safe mode is on.

; Color of syntax highlighting mode.
; As long as something that can be accepted by <font color=???> can work.
= #DD0000
= #FF8000
= #007700
= #FFFFFF
= #0000BB
= #000000

; Misc Misc
expose_php = Off
; Determines whether PHP indicates the fact that it is installed on the server (for example: add it - PHP - to the Web service
; on the sent signal).
; (My personal opinion, when there is any power-by header, turn it off.)
; It will not have security threats, but it makes it possible to check if PHP is installed on your server.



; Resource Limits ;


max_execution_time = 30; Maximum execution time for each script, calculated in seconds
memory_limit = 8388608; The maximum amount of memory available for a script (here is 8M



; Error handling and logging ;
; Error control and registration;

; Error reports are bitwise. Or add up the numbers to get the desired error reporting level.
; E_ALL - All errors and warnings
; E_ERROR - Fatal runtime error
; E_WARNING - Runtime Warning (non-fatal error)
; E_PARSE - Compile-time parsing error
; E_NOTICE - Runtime reminders (these are often caused by bugs in your code,
;It may also be caused by intentional behavior. (For example: automatically initializes a variable based on uninitialization
; the fact of an empty string is used while using an uninitialized variable)

; E_CORE_ERROR - Fatal error occurred during initialization at PHP startup
; E_CORE_WARNING - Warning that occurs during initialization at PHP startup (non-fatal error)
; E_COMPILE_ERROR - Fatal error during compilation
; E_COMPILE_WARNING - Compile-time warning (non-fatal error)
; E_USER_ERROR - Error message generated by the user
; E_USER_WARNING - User generated warning message
; E_USER_NOTICE - User-generated reminder message
; example:
; error_reporting = E_ALL & ~E_NOTICE ; Shows all errors except reminders
; error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR; only errors are displayed
error_reporting = E_ALL & ~E_NOTICE ; Shows all errors except reminders
display_errors = On ; displays error message (as part of the output)
; On the final published web site, it is highly recommended that you turn off this feature and use it
; Error log instead (see below).
; Continue to make display_errors effective in the final published web site possible
; Expose some security information, such as file paths on your web service,
; Your database planning or other information.
display_startup_errors = Off ; Even when display_erroes is turned on, it happens in the startup step of PHP
; errors will not be displayed.
; It is strongly recommended to keep display_startup_errors closed,
; Except in the process of correcting errors.
log_errors = Off ; log errors in the log file (server specified log, stderr standard error output, or error_log (below))
; As stated above, it is highly recommended that you log errors on the final published web site
; Replaces direct error output.

track_errors = Off ; Save the latest error/warning message in the variable $php_errormsg (boolean)
;error_prepend_string = "<font color=ff0000>" ; string output before the error message
;error_append_string = "</font>" ; string output after error message
;error_log = filename ; Record error log in the specified file
;error_log = syslog ; Record error logs in system log syslog (event log under NT, invalid under Windows 95)
warning_plus_overloading = Off ; warning when '+' is used for strings



; Data Handling ;

variables_order = "EGPCS" ; This indication describes the PHP record
; GET, POST, Cookie, Environment and Built-in The order of these variables.
; (represented by G, P, C, E & S, usually referenced in the form of EGPCS or GPC).
; Press to record from left to right, and the new value replaces the old value.

register_globals = On ; Whether to register these EGPCS variables as global variables.
; If you don't want the user data to be confused globally, you may want to turn it off.
; This makes more sense to use with track_vars - so you can pass
; $HTTP_*_VARS[] Array accesses all GPC variables.

register_argc_argv = On ; This indication tells PHP whether to declare argv and argc variables
; (Note: here argv is an array, argc is the number of variables)
; (It contains data transmitted using the GET method).
; If you don't want to use these variables, you should turn it off to improve performance.
(Source: The bird that is poor on the sun)