We help IT Professionals succeed at work.

setting a max file upload size for a domain

andy7789 asked
Hi X-perts,

I have a dafault php max upload size 7M and need to increase it to 17 to a specific directory. This is my vhost.conf:

<Directory /usr/local/psa/home/vhosts/xxx.com/httpdocs>
 php_admin_flag safe_mode off
 php_admin_flag register_globals off
 php_admin_value open_basedir "/usr/local/psa/home/vhosts/xxx.com/httpdocs:/"
 php_admin_value upload_max_filesize "17M"

It does not work and the default file size is still 7M.

What is wrong here?

Thank you
Watch Question

blue_hunterTechnical Lead

you have to increase the below options in the  accordingly

    php_value upload_max_filesize 52428800
    php_value max_execution_time 120
    php_value post_max_size 100M


should 100M be in quotes like "100M"?

also, why the values upload_max_filesize and post_max_size are different?
Technical Lead
no, not in need to quote them

Files are usually POSTed to the webserver in a format known as 'multipart/form-data'. The post_max_size sets the upper limit on the amount of data that a script can accept in this manner. Ideally this value should be larger than the value that you set for upload_max_filesize.

It's important to realize that upload_max_filesize is the sum of the sizes of all the files that you are uploading. post_max_size is the upload_max_filesize plus the sum of the lengths of all the other fields in the form plus any mime headers that the encoder might include. Since these fields are typically small you can often approximate the upload max size to the post max size.

further information about post_max_size and upload_max_filesize can find at the below link

Explore More ContentExplore courses, solutions, and other research materials related to this topic.