How to set core PHP directives (e.g. upload_max_filesize)

Some PHP scripts may require settings different from the defaults configured in the server's php.ini file. You can change many of these settings by using php_value and php_flag directives in the .htaccess file in your web site's root folder.

Here are a few example settings:
(do not just add these, only change what is required by your scripts/website coding)

php_flag display_errors Off
php_value post_max_size 15M
php_value upload_max_filesize 15M

Some notes from the documentation on post_max_size and upload_max_filesize:


  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I enable PHP error logging?


How do I disable the server RAM cache during website development?


How do I enable PHP short tags?
