Maximize the maximum values in php scripts

In some cases you need to make a custom script for uploading files or even update / synchronize two databases.  The php execution time has some restrictions, for security reasons. If a scripts takes more than apache server expects to take the whole procedure stops and your update script does not complete what its meant to do. In those cases you can actually do some changes like this

Find the php.in (in case you run a script in your local server). In a case you have to change tha php.ini in a hosted site, some hosters do give you this option.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
max_execution_time = 240     ; Maximum execution time of each script, in seconds
max_input_time = 240    ; Maximum amount of time each script may spend parsing request data
memory_limit = 20M      ; Maximum amount of memory a script may consume (8MB)

if you post many data change this line (as you need to)

; Maximum size of POST data that PHP will accept.
post_max_size = 30M

If you need to upload file more than tha default (2M – 10M)

; Maximum allowed size for uploaded files.
upload_max_filesize = 25M

Leave a Reply

Your email address will not be published.