简体   繁体   English

增加 Azure VM 中托管的 Wordpress 的最大文件上传大小

[英]Increase max file upload size in Wordpress hosted in Azure VM

After being fed up with Godaddy hosting, I am trying to migrate my site to Azure VM.在受够了 Godaddy 托管之后,我正在尝试将我的站点迁移到 Azure VM。 I am stuck at maximum file upload size limit which is fixed at 40 MB, while my site backup file is around 850 MB.我被固定在 40 MB 的maximum file upload size limit所困,而我的站点备份文件约为 850 MB。
Adding below lines in .htaccess file through WP File Manager didn't work.通过WP File Manager.htaccess文件中添加以下行无效。 No luck with restarting VM too.重启虚拟机也不走运。

php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

Is there some workaround to increase size of file upload?是否有一些解决方法来增加文件上传的大小? How do I see site files?我如何查看站点文件? I feel CPanel's File Manager was pretty good and straight forward.我觉得 CPanel 的文件管理器非常好而且简单明了。

Uploading .user.ini file with below content to htdocs folder fixed the issue.将包含以下内容的.user.ini文件上传到htdocs文件夹解决了这个问题。 Make sure to use Advanced File manager plugin to upload the file.确保使用Advanced File manager插件上传文件。 Other Wordpress file managers don't allow files that start with dot .其他 Wordpress 文件管理器不允许以dot开头的文件。

memory_limit=256M
upload_max_filesize=1024M
post_max_size=1024M
max_execution_time=300
max_input_time=300

在此处输入图像描述

In case someone is still reading this.万一有人还在读这个。 The default Azure WebApp allows 8MB upload.默认的 Azure WebApp 允许上传 8MB。 To increase to 64MB, I did the following.为了增加到 64MB,我做了以下操作。

In.user.ini in /site/wwwroot I added.在/site/wwwroot 中的.user.ini 中我添加了。

memory_limit = 256M
post_max_size = 76M
upload_max_filesize = 64M

In web-config.php I added.在我添加的 web-config.php 中。

define('WP_MEMORY_LIMIT', '1024M');

I am using Project Nami WordPress on an IIS server so I had to do add the following to web.config.我在 IIS 服务器上使用 Project Nami WordPress,所以我必须将以下内容添加到 web.config。

  <security>
     <requestFiltering>
        <requestLimits maxAllowedContentLength="67108864"/>
     </requestFiltering>
  </security>

Then rebooted the web app in the Azure portal.然后在 Azure 门户中重新启动 Web 应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM