In PHP, you can customize the PHP's directives in three levels:
- global level: php.ini file
- virtual host or directory level: httpd.conf or .htaccess
- executing php script level: ini_set() function
There is a configuration directive scope attached to each parameter. Refer to the
documentation of the directives for more details. In the php.ini file note that starting a line with a semicolon (";") comments it out, so PHP will not read it.
I make a list of commonly used configuration directives (parameters) that help to customize the behavior of PHP.
I am not saying you have to change the value of the directives, this just mention the effect of setting the value specified.
The directives here are only relevant to PHP's general behavior, not related to an specific extension.
- zend.ze1_compatibility_mode = on , allows PHP4 applications to run in version 5 without problems. =) Cool, isn't?
- short_open_tag = on , allow the following scape format:
- output_buffering = on , send all output of a script at once, after the script has been completed. It allows make changes to the HTTP header throughout the script. No more "Cannot add header information - headers already sent".
- implicit_flush = on , flush the content of the output buffer after each call to print() or echo(). Useful where the server requires an unusually long period of time to perform something, and you want to show status update to the user rather than just wait.
- max_execution_time = number , maximum amount of seconds that a PHP script can execute.
- max_input_time = number , seconds that a PHP script devotes to parsing request data. Important when you upload large files.
- error_reporting = E_ALL , reports ALL errors and warnings (level of error-reporting sensitivity). Check the manual for other values.
- display_errors = on , show the error from the level specified by error_reporting directive.
- log_errors = on , any error will be logged to a particular file or to the syslog specified by error_log directive.
- error_log = "file" , if log_errors is enabled, this directive specifies the message destination.
- register_globals = on , enable this is a security risk Make globally available any external variable of the type COOKIE, ENVIRONMENT, GET, POST, and SERVER without its type. For example, use $var instead of $_GET['var']
- post_max_size = #M , maximum Mbytes of data can be sent via POST to a PHP script.
- magic_quotes_gpc = on , all single and double quotes, backslashes, and null chars are automatically escaped with a backslash. Only valid for data transmitted via GET, POST, and COOKIE.
- include_path = ". ; path" , this path serves as the base path used by functions such as include(), require(), etc. Separate multiple directories with a semicolon (;)
- doc_root = "path", used only if it is not empty. Indicate the default from which all PHP scripts will be server.
- open_basedir = ''path" , set a base directory to which all file operations will be restricted.
- file_uploads = on , enable the file uploading feature.
- upload_tmp_dir = "path" , temporary directory where files are first uploaded to the server.
- upload_max_filesize = #M , maximum Mbytes of the size of the file being uploaded.
- extension_dir = "path" , tells the directory in which the loadable extensions (modules) reside. The default, "./", means the extensions are located in the same directory as the executing script.
- enable_dl = on, allows to load PHP extension at run time.
- extension = "file" , dynamically load a particular module. Make sure that the appropriate software is installed on the operative system.
I hope this summary can we useful.
Mr. Anderson