Home >Backend Development >PHP Tutorial >How to modify the upload size limit of php files

How to modify the upload size limit of php files

WBOY
WBOYOriginal
2016-07-25 08:51:231090browse
  1. //Find

  2.  Options FollowSymLinks
  3.  AllowOverride None
  4. //Change to

  5. < ;Directory />
  6.  Options FollowSymLinks
  7.  AllowOverride All
  8. //That’s it

Copy the code

Create a new .htaccess file in the directory. Windows does not allow this by default. If you do, you can create a new one under Dreamweaver's file management, and it won't work anymore.

Write in .htaccess

  1. php_value post_max_size 12m
  2. php_value upload_max_filesize 12m
  3. php_value max_execution_time 120
  4. php_value max_input_time 240
Copy the code

and it’s OK

Additional explanation: The method of using ini_set("post_max_size", "80M"); will not work.

The modifiable range of post_max_size is PHP_INI_PERDIR. PHP_INI_PERDIR is an intra-domain directive that can only be modified in the php.ini, httpd.conf or .htaccess file, so it will not work. php_value name value Sets the value of the specified command. Can only be used with directives of type PHP_INI_ALL and PHP_INI_PERDIR. To clear the last set value, set the value to none .

Note: Do not use php_value to set boolean values. php_flag (see below) should be used instead. php_flag name on|off Configuration directive used to set the type of boolean value. Can only be used with directives of type PHP_INI_ALL and PHP_INI_PERDIR. php_admin_value name value

Set the value of the specified command. Cannot be used in .htaccess files. Any value set in php_admin_value cannot be overridden by directives in .htaccess or virtualhost. To clear the last set value, set the value to none . php_admin_flag name on|off



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn