Most Frequently used php configuration directives : php.ini


Below are the most frequntly used php directives.
You have to change php.ini file for making confuguration level setting.
This just means changing these directive’s option and value.

Php.ini file is configuration file for php, You can find the location of php.ini file from
Go to http://locahost/xamp and the click phpinfo()

1) short_open_tag = Off

 This will not allow the shout tags like , if this is set off

2) max_execution_time = 30

Maximum execution time of th script, in seconds

3) error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

This shows all errors, except coding standards warnings. Some more examples for
error_reporting setting:
- Show all errors, except for notices and coding standards warnings
error_reporting = E_ALL & ~E_NOTICE
- Show all errors, except for notices
error_reporting = E_ALL & ~E_NOTICE | E_STRICT
- Show only errors
error_reporting= E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

4) display_errors = On

Print errors (as a part of the output). For production web sites turn this feature off, and use error logging instead (see below). Keeping display_errors enabled on a production web site may reveal security information to end users, such as file paths on your Web server, your database schema or other information.

5) log_errors = On

Create Log of errors into a log file (server-specific log, or error_log). You should use error logging in place of error displaying on production web sites.

6) register_globals = Off

You should do your best to write your scripts so that they do not require register_globals to be on.
Using form variables as globals can easily lead to possible security problems, if the code is not very well. Making register_global  on can make securitry hole.

7) memory_limit = 128M

This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server.

8) post_max_size = 8M

Maximum size of POST data that PHP will accept. In the above example Post max size is 8MB.
This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is set by your configure script, memory_limit also affects file uploading. Generally , memory_limit should be more than post_max_size .

9) file_uploads = On

Allow HTTP file uploads or not.

10) upload_max_filesize = 2M

Maximum allowed size for uploaded files. Default is  2MB.

11) allow_url_fopen = On

Allow the treatment of URLs (like http:// or ftp://) as files if on.

No comments: