8

Wordpress上传文件大小限制修改

 3 years ago
source link: http://www.yzipi.com/3134.htm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

WordPress上传文件大小限制修改

最后更新 : 2020.01.30  

eg.png

WordPress上传媒体文件默认大小限制是2M或8M,当文件大于这个限定大小时,是上传不了的。其实这大小并不是Wordpress限制,而是PHP服务器为了性能考虑,默认的一个限定。那如何修改上传媒体大小的限制?

如果你购买的是虚拟主机,即空间,这件事,你就得找IDC商帮你处理。如果你是个人服务器或VPS,这个就要你自已设置。

找到服务器端php.ini配置文件,找到这几个参数项 memory_limitpost_max_sizeupload_max_filesizemax_execution_timemax_input_time

memory_limit=128M //相当于单个脚本可调用内存大小

post_max_size=8M //上传文件大小上限(此参数应>=upload_max_filesize)  

upload_max_filesize=2M //默认上传文件大小,这个就是2M的限制!

max_execution_time=30 //最大执行时间,页面等待时间

max_input_time=60 //接收数据最大时间限制

其中影响最大上传尺寸的设置项是 upload_max_filesizepost_max_size,其他几个选项主要是为了防止上传程序使用过多的内存和因为网络原因造成的执行时间过长,导致网站速度变慢。

试着把 upload_max_filesizepost_max_size 分别改成 66和88,然后重启服务器,你看最多上传文件大小是不是已经变成了66M了。

- END -


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK