Home > Backend Development > PHP Tutorial > php ini_set post_max_size,upload_max_filesize

php ini_set post_max_size,upload_max_filesize

WBOY
Release: 2016-06-23 14:36:34
Original
1194 people have browsed it

转自:http://www.webzone8.com/article/80.html

ini_set('max_execution_time','10'); ini_set('memory_limit','1024M'); echo 'max_execution_time = ' . ini_get('max_execution_time') . "
"; echo 'memory_limit = ' . ini_get('memory_limit') . "
"; echo 'post_max_size = ' . ini_get('post_max_size') . "
"; echo 'upload_max_filesize = ' . ini_get('upload_max_filesize') . "
"; ini_set('max_execution_time','10'); ini_set('memory_limit','1024M'); [separator]

注意: post_max_size,upload_max_filesize用下面的方法是修改不了的.

ini_set('post_max_size','1024M'); ini_set('upload_max_filesize','1024M');

正确做法是用.htaccess文件:

php_value upload_max_filesize 50M php_value post_max_size 898M

补充知识点:

其实在php文档里有说明upload_max_filesize的可修改范围是PHP_INI_PERDIR。

PHP_INI_PERDIR的意思是域内指令可以在php.ini、httpd.conf或.htaccess文件中修改。

 PHP_INI_SYSTEM 域内指令可以在php.ini和httpd.conf文件中修改所以upload_max_filesize用int_set是无法修改的。只有可修改范围是PHP_INI_ALL的才可以用int_set修改。


------------------------------


php上传文件需要配置:

post_max_size

upload_max_filesize

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template