Our website was recently update to Wordpress 5.1.1. From this recent update we had some issues that we have trouble debugging.

1. Cannot view media files on post editor

Clicking the "Add media" button shows the media selector modal, but it just stays there loading infinitely. This prevents us to add images to posts. There is nothing in the WP debug logs and in console logs.

2. Forbidden permission error

You don't have permission to access /wp-admin/admin-ajax.php on this server.

There is a forbidden permission error that suddenly showed after update. We have a hunch that this is related to the error above, but we're not entirely sure.

Widget displaying error.

We did a few things to help debug or fix the issue:

  • Updated the PHP version in the server
  • Deactivated all plugins and tried to add image to post. Still stuck on infinite loading so it was not a plugin issue.
  • Updated the permission access to the file admin-ajax.php, but issue still persists

We do not know what our next steps should be. We are not really knowledgeable with Wordpress hostings and servers and are currently learning as we go. Any suggestions and help are appreciated.

1 Answer 1


Enable DEBUG in wp-config.php OR Check the Apache and / or NGINX logs for a more accurate analysis of the error.

About your error .. This looks like file permission. If you use command line use:

Chmod 0644 /wp-admin/admin-ajax.php

If it does not resolve, you should use the command below. But note this command should be changed soon after by the aforementioned (chmod 0644).

Total Permission Command:

chmod 0777 /wp-admin/admin-ajax.php

Like I told you after making your changes. Go back to chmod 0644.

Search about File Permissions and will understand that chmod 0777, should be avoided at most.

Do not forget to always before and after major changes ... You should do a full backup. That is, files + database.

If you are not using the command line. Go through the File Manager and look for the file permission change option. Change only what you are sure. You can use the numbers above. Without the >> Chmod. 0644 or 0777

On the media files, I believe it's the same permissions problem ... In short, you should as STANDARD put to:

PASTES AND SUBPASSES chmod 0755 or 0755 (in the directory)
Files chmod 0644

Only Folders and Files that Need Recording Continue ... Chmod 777 (But it is not advisable)

This depends a lot on your server. Then consult him to find out the correct permission. It can be Chmod 0700 // 0744 (Search)

Since you are learning ... I'll give you some tips ...

Always keep in mind the Web Server. This is not your machine, but the software that manages your websites. It's usually Apache. So keep in mind that when you are looking for details about errors or doubts always insert the Web Server as a reference.

Ex: wordpress + NGINX (Apache) + Error / Doubt

This will help you ... Another important fact is to focus on the mistakes is as I said above, analyze the LOGS. Be it Wordpress or your Web Server.

I hope I have helped you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.