Below are commonly used php directives, which can be changed in php.ini file (we use Linux so its path is like that: /etc/php5/apache2/php.ini) or its called php configuration file or php configure setting.
1> By default the execution time in php is 30 but If we want to increase the execution time we have to move into php.ini file and change the execution time.
max_execution_time = 30
Note: Maximum execution time of each script, in seconds
2> If it shows an Error on running page in php then use:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT (This shows all errors)
- 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
3> If page print out errors as a part of the output then we use:
display_errors = On
4)If We need to access all attributes only by Global Arrays( GET[], POST[] & REQUEST[] ) then we use:
register_globals = Off
5> If we want to increase the memory limit in php then sets the maximum amount of memory in bytes. This increase the memory limit of php script.
memory_limit = 128M
6> By deafult post max size is 8M. If we Maximize the size of POST data then use:
post_max_size = 8M
This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading.
Generally
memory_limit > post_max_size.
7> When we upload the file having size greater than 2M it gives the error:
(Uploaded File Exceeds upload_max_filesize) then we have to use upload_max_filesize in php.ini file and increase its size according to our uploaded file size:
upload_max_filesize = 2M
8> Whether to allow the treatment of URLs (like http:// or ftp://) as files then we allow the url open:
allow_url_fopen = On
0 Comment(s)