Rootop 服务器运维与web架构

更改php上传限制(phpmyadmin Import上传限制)

| 暂无评论

当对sql脚本通过phpmyadmin导入时,会有个提示,不能上传大于2M的文件,要不会报错。更改此限制方法:

编辑php.ini配置文件

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://www.php.net/manual/en/ini.core.php#ini.file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://www.php.net/manual/en/ini.core.php#ini.upload-tmp-dir
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
; http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize

upload_max_filesize = 5M
memory_limit =   10M  //要大于upload_max_filesize
post_max_size =   10M   //要大于upload_max_filesize

phpmyadmin帮助文档:
The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize.

重启apache生效!

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/912.html

作者:Venus

服务器运维与性能优化

发表回复