0

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

natyus
  • 577
  • 1
  • 4
  • 19

1 Answers1

0

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?

nsilva
  • 5,184
  • 16
  • 66
  • 108
  • Hi, Sorry for the late reply a lot of stress at work. I had a "hello" inside my code which was the problem after deleting it worked. – natyus Jun 22 '22 at 18:40
  • That's great news @natyus - Hopefully the above will help somebody else in future. The best thing is to check the console log in future. Or your PHP error logs. Take care and happy coding! – nsilva Jun 25 '22 at 01:04