如何为WordPress配置XAMP以安装插件

发布于 2025-02-08 18:39:01 字数 1050 浏览 1 评论 0 原文

我在PC上使用XAMP在本地安装了WordPress(MacBook Pro Apple Silicon 2021),昨天我可以正常安装插件(启动模板),但是今天,如果我尝试安装一个插件通常应该说激活,但是当我重新加载页面时,它已安装,我可以单击激活,但不会激活它。尝试安装时,我会收到以下消息:

Installation failed: Hello World!{"success":true,"data":{"install":"plugin","slug":"jetpack","pluginName":"Jetpack – WP Security, Backup, Speed, & Growth","debug":["Downloading installation package from https:\/\/downloads.wordpress.org\/plugin\/jetpack.11.0.zip…","The authenticity of jetpack.11.0.zip could not be verified as no signature was found.","Unpacking the package…","Installing the plugin…","Plugin installed successfully."],"activateUrl":"http:\/\/localhost\/wordpress\/wp-admin\/plugins.php?_wpnonce=0ec70b4569&action=activate&plugin=jetpack\/jetpack.php"}}

当我尝试发布页面时,我得到的响应不是有效的JSON。

我尝试将sudo chmod 777进行到htdocs页面,但这无济于事,我在wp-config中设置了以下内容:

/** In order to install plugins */
 define( 'FS_METHOD', 'direct' );

昨天它已经有效了,但今天不再使用,我正在使用XAMP和WordPress的最新版本

I installed wordpress locally with xamp on my pc (Macbook pro Apple silicon 2021), yesterday I could normaly install a plugin (starter template) but today if I try to install a plugin it says at first "update failed" on the button where it should usually say activate but when I reload the page it is installed and I can click on activate but it does not activate it. When trying to install I am getting the following message:

Installation failed: Hello World!{"success":true,"data":{"install":"plugin","slug":"jetpack","pluginName":"Jetpack – WP Security, Backup, Speed, & Growth","debug":["Downloading installation package from https:\/\/downloads.wordpress.org\/plugin\/jetpack.11.0.zip…","The authenticity of jetpack.11.0.zip could not be verified as no signature was found.","Unpacking the package…","Installing the plugin…","Plugin installed successfully."],"activateUrl":"http:\/\/localhost\/wordpress\/wp-admin\/plugins.php?_wpnonce=0ec70b4569&action=activate&plugin=jetpack\/jetpack.php"}}

And when I try to publish a page I am getting that the response is not a valid json.

I tried to do sudo chmod 777 to the htdocs page but it did not help, I set in my wp-config the following:

/** In order to install plugins */
 define( 'FS_METHOD', 'direct' );

This had worked yesterday but not today anymore, I am using the latest version of Xamp and wordpress

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水波映月 2025-02-15 18:39:01

自从停止工作以来,您是否可以详细说明?

尝试将JetPack插件移至其父目录,然后从

如果那不起作用,您可以尝试以下几件事:

  1. 设置中检查URL »一般,对于大多数网站,WordPress地址(URL)和网站地址(URL)字段应相同。
  2. 重置永久链接,转到设置»永久链接并进行更新而无需进行任何更改。
  3. 将您的.htaccess重命名为.htaccess-bk,然后将.htaccess文件更改为默认值,如图所示
  4. 下载免费插件 健康检查&故障排除 并检查错误(尤其是涉及REST API的错误)。
  5. 尝试切换到WordPress默认主题,看看问题是否在更新时发生,如果问题已解决,则可能是您使用的主题的问题。如果您在WordPress 6中使用默认主题,则可以尝试激活2022个主题,然后尝试再次更新插件。
  6. 尝试一一停用插件,以查看是否存在造成此错误的罪魁祸首...在一一停用后测试,以确保您重新激活前一个并在两者之间进行测试更新。

您还可以检查您的 wp-config.php 文件,然后更改以下内容:

define( 'WP_DEBUG', false );

define('WP_DEBUG', true);

出现进一步的错误?让我知道他们是否这样做。

我想我在这里添加的唯一更多信息是检查与文件权限的不一致之处。使用WordPress,目录往往为755和文件644。请参阅以下帖子,以获取有关此内容的进一步阅读:

WordPress的正确文件权限

出于您为什么不使用的原因,

define( 'FS_METHOD', 'direct' );

请参见下面的链接:

Can you elaborate if there have been any changes since this stopped working?

Try moving the JetPack plugin to its parent directory and then re-downloading the free version from the WordPress Plugin Directory.

If that doesn't work, here are a few things you could try:

  1. Check URLs in Settings » General, for most websites, the WordPress Address (URL) and Site Address (URL) fields should be the same.
  2. Reset Permalinks, go to Settings » Permalinks and update without making any changes.
  3. Rename your .htaccess to .htaccess-bk then change the .htaccess file to default as shown here.
  4. Download the free plugin Health Check & Troubleshooting and check for errors (especially ones involving REST API).
  5. Try switching to the WordPress default Theme and see if the problem occurs when updating, if the issue is fixed, it could be an issue with the theme you are using. If you are using the default theme in WordPress 6, you could try activating the Twenty Twenty-Two theme and try updating plugins again.
  6. Try deactivating plugins one by one to see if there is a culprit causing this error... Test after deactivating one by one ensuring that you re-activate the previous one and test updates in between.

You could also check your wp-config.php file, and change the following:

define( 'WP_DEBUG', false );

to

define('WP_DEBUG', true);

Do any further errors show up? Let me know if they do.

I guess the only further information I could add here is to check for inconsistencies with the file permissions. With WordPress, directories tend to be 755 and files 644. See the below post for further reading in regards to this:

Correct file permissions for WordPress

For reasons as to why you shouldn't use:

define( 'FS_METHOD', 'direct' );

See the below link:

What security concerns should I have when setting FS_METHOD to "direct" in wp-config?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文