Fish in the river

思考 技术
记录 回忆
  1. Main page
  2. 运维技术
  3. Dock
  4. Main content

解除wordPress上传2MB的限制

2024年12月26日 30hotness 0likes 0comments

通过WordPress的管方Docker Image构建出来Container后,会发现上传会被限制在2MB。

下面我就记录一下,如何解除这个限制。

1.创建一个Wordpress.ini文件。文件内容如下:

file_uploads = On
memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 1000

以上通过upload_max_filesize和post_max_size两个参数来改变上传文件的大小。

2.通过 sudo docker compose stop 停止Container. 有的教程使用sudo docker compose down 来停止container。这两者的区别在于使用使用关键字Down的时候会全部初始化。所以我建议使用stop关键字。

修改Docker-compose.yml文件。修改地方如下:

3.通过以下命令重新加载Container

sudo docker compose up -d

4.可以通过上传文件时的地方查看到,上传文件大小已被改变。

Tag: Wordpress
Last updated:2024年12月26日

joey

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

归档

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024

分类目录

  • C#
  • Dock
  • Excel
  • Kindle
  • Linux
  • Windows
  • 生活感悟
  • 群晖
  • 运维技术

COPYRIGHT © 2024 水中小鱼. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang