Home > Article > Backend Development > html - How to set post_max_size and upload_max_filesize in my own php script??
How to set the maximum size of uploaded files in your own script? Without modifying the initial configuration of php.ini, ini_set does not seem to take effect on this configuration item! ! !
How to set the maximum size of uploaded files in your own script? Without modifying the initial configuration of php.ini, ini_set does not seem to take effect on this configuration item! ! !
PHP configuration has four modes.
PHP_INI_USER
PHP_INI_PERDIR
PHP_INI_SYSTEM
PHP_INI_ALL
When this configuration is the first or fourth type, you can use ini_set()
.
And post_max_size
and upload_max_filesize
are both the second type, so they cannot take effect.
If the subject is using a virtual host, you can change php.ini
in the control panel of the virtual host. Most virtual hosts provide these two configuration changes
The modifiable range of these two configurations is PHP_INI_PERDIR
, that is, it can only be configured in the configuration file, and the modification of ini_set
is invalid.
http://php.net/manual/zh/conf...