无法上传媒体文件到WordPress网站。

huangapple go评论49阅读模式
英文:

Cannot upload media files to wordpress website

问题

我已为我的WordPress网站创建了一个新项目和部署。我按照Google指导教程的每个步骤进行操作,但出现了2个问题:

  1. 部署页面上出现错误消息(请参见附件) - 我如何解决运行时配置问题?我只是按照这里的指南进行操作的。
    部署问题图像

  2. 我无法通过我的WordPress网站上传任何媒体文件,每次尝试都只得到一个灰色框 - 是否有API我可能没有启用?我已经搜索了您的文档,但尚未找到任何信息。
    媒体文件上传问题

我已附上问题的截图。

我对Google Cloud平台还相当新,非常感谢任何帮助。

谢谢!

尝试联系支持,但他们说这不在他们的范围之内,不愿提供帮助。

英文:

I have created a new project and deployment for my WordPress website. I followed each step of the Google guided tutorial and have come across 2 issues:

  1. Error message on deployment page (see attachment) - how do I resolve the Runtime Config issue? I have only followed the guide here
    deployment issue image

  2. I cannot upload any media files through my WordPress website, when I try all I get is a grey box - Is there an API that I may have not enabled? I've searched your documentation and have not found anything as of yet.
    media file upload issue

I have attached screenshots of the issues.

I'm pretty new to the Google Cloud Platform so any assistance is greatly appreciated.

Thank you!

Tried contacting support who would not help as they said it's out of their scope

答案1

得分: 0

关于您的第一个问题,WordPress Click to Deploy,错误消息无法解决。这是因为该产品没有更新。作为一个测试版产品,没有支持。您的选择是继续使用产品,或者使用传统的方法创建虚拟机,安装Apache、PHP和MySQL。如果您只是在学习,Click to Deploy 就可以。您可以轻松自己更新该产品。

您的第二个问题非常常见。大多数安装方法使用默认的PHP配置设置,因此了解以下信息将帮助您解决许多类似的问题。

要更改最大文件上传大小,您必须更改Apache正在使用的PHP版本的一些设置。一个服务器可以安装多个PHP版本,因此您必须修改正确的安装。几乎所有运行Apache的服务器至少安装了两个版本。

要确定您的服务器正在使用哪个php.ini,请创建一个PHP页面:

<?php
phpinfo();

将该页面加载到浏览器中。查看以下部分:

无法上传媒体文件到WordPress网站。

从截图中注意到两个项目:

  • PHP的版本
  • 配置文件(php.ini)路径的位置

PHP 7.4 FPM的示例

编辑 /etc/php/7.4/fpm/php.ini

  • upload_max_filesize = 2M 更改为所需的大小
  • post_max_size = 8M 更改为所需的大小
  • 重新启动服务器。根据Apache/PHP配置的不同,重新启动Apache并不总是重新加载PHP设置(例如,PHP FPM)。
英文:

For your first problem, WordPress Click to Deploy, the error message cannot be resolved. This is because the product is not updated. As a beta product, there is no support. Your option is to continue with the product as is or use the traditional method of creating a VM, installing Apache, PHP, and MySQL. If you are just learning, the Click to Deploy is fine. You can update the product yourself easily.

Your second problem is very common. Most install methods use the default PHP configuration settings, so knowing the following will help you with many similar problems.

To change the maximum file upload size, you must change a few settings for the PHP version Apache is using. A server can have multiple PHP installations so you must modify the correct installation. Almost all servers running Apache have at least two versions installed.

To determine which php.ini your server is using, create a PHP page:

&lt;?php
phpinfo();

Load that page into a browser. Review the following section:

无法上传媒体文件到WordPress网站。

Notice two items from the screenshot:

  • The version of PHP
  • The location of the Configuration File (php.ini) Path

Example for PHP 7.4 FPM

Edit /etc/php/7.4/fpm/php.ini

  • Change upload_max_filesize = 2M to the required size
  • Change post_max_size = 8M to the required size
  • Reboot the server. Depending on the Apache/PHP configuration, restarting Apache will not always reload the PHP settings (e.g. PHP FPM).

huangapple
  • 本文由 发表于 2023年7月18日 09:04:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76708939.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定