添加文件上传功能:
在 localsettings.php 中 $wgEnableUploads = true; ## 允许上传$wgUploadPath = "$wgScriptPath/uploads"; ## 默认为 "$wgScriptPath/images" ,请确保目录可写$wgUploadDirectory = "$IP/uploads"; ## 默认为 "$wgScriptPath/images"$wgMaxUploadSize = 20000000; ## 20M 上传文件尺寸上限$wgUploadSizeWarning = 10000000; ## 10M 上传文件尺寸超过该值,则警告 ##允许上传文件的扩展名$wgFileExtensions = array('png','jpg','jpeg','gif','ogg','doc','docx','xls','xlsx','ppt','pptx','mp3','sxc','pdf','nse');##安全的文件上传模式,文件不是直接放在 UploadPath下,而是它下面的一些随机生成的子目录中。$wgHashedUploadDirectory = true;在 php.ini 中修改文件上传相关的参数。memory_limit = 256 Mpost_max_size = 25Mupload_max_filesize = 20M 总的原则是 memory_limit > post_max_size > upload_max_filesize > wgMaxUploadSize > UploadSizeWarning