PHP supports the following resource limits directives in php.ini file:
- max_execution_time : Maximum execution time of each script, in seconds.
- max_input_time : Maximum amount of time each script may spend parsing request data.
- memory_limit : Maximum amount of memory a script may consume.
# vi /etc/php.ini
Set up values as follows:
max_execution_time = 30Set maximum size of POST data that PHP will accept:
max_input_time = 30
memory_limit = 40M
post_max_size = 8MSet maximum allowed size for uploaded files:
upload_max_filesize = 2MTurn on or off HTTP file uploads (disallow uploading unless necessary):
file_uploads = OffMake sure PHP redirects appropriately with the following:
cgi.force_redirect = 0Disable file requests as fopen calls with the following
allow_url_fopen = OffTurn on SQL safe mode:
sql.safe_mode = OReload Apache web server:
# service httpd reload
OR
Reload lighttpd web server:
# /etc/init.d/lighttpd reload
Note any attempt to exceed these limits will result in a "500 Server Error".
No comments:
Post a Comment