You don't have permission to access /wp-admin/

2020-03-30 04:03发布

The question was edited 3 times and it now includes VPS and Centos tags, because i think there is something wrong with my VPS config file.


Ok, first, I've looked through all the questions asked here, and there is no answer to the issue I have.

The problem is that when I try to copy/paste and update or create WP post, I get this warning that says: "You don't have permission to access /wp-admin/post.php on this server."

The strangest thing is that when I copy/paste it mostly crashes only if there are some special format like Italic or any symbol, but not every like (). So if I paste text, it mostly crashes but not always.

Now, to make the things even stranger, I had a post that was doing just fine, I mean it used to appear fine on the blog. Then I've tried to create a contact page, I've published it and it didn't show on the blog. There was a message saying nothing found there on the link. Then I've started to click around and I've noticed my post that was doing right disappeared too. I mean it's still there, but when you click on read more it says nothing found.

I've turned off all the plugins I'm using (in fact only Fourteen Color) and have changed the theme, but with no result at all.

Any idea why does this happen? I'm hosting it on a virtual server and there are running 2 sites more at the same Ip, but I don't think, this could be the problem. Previously I was playing with SSL and I thought that might be the problem, but then I deleted the domain and have created anything from scratch and the issue persists.

Pd. When I try to publish a raw entered text from the keyboard I've no problems, but when I paste it, it usually crashes the post.

Edit: My .htaccess file is here:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Edit 2: It seems I can't post links too. When I try to post a link I get the same error.

Edit 3: I'm trying to locate the php log file, but it seems there's nothing there. So my thought is: what if the error have to do with wp trying to write the log but it can't get permission? I have the php logs enabled in the config so there should be at least one, but i can't find any. Does anyone can tell me, where I have to look for the logs. Now I'm looking on /var/log but there are no php log file.

2条回答
劳资没心,怎么记你
2楼-- · 2020-03-30 04:41

I had an issue like yours a few years ago and it drove me crazy, but I had to try out some solutions to finally find out the perfect one for me. Try one of these, they can't do no harm:

First: try to CHMOD your post.php to 774. Or even better, for the sake of your solution, chmod your wp-admin and wp-content folder to 777 and see if it works and then switch it back, so you will be able to pin point it.

Second: Add this part to the beggining of your .htaccess file:

<Files post.php>
Order Deny,Allow
Deny from all
Allow from all
</Files>

Instead of "all" in the "Allow from all" field you can just enter your IP.

Third: In my case, renaming this part

<IfModule mod_rewrite.c>

to this

<IfModule mod_rewrite.so>

helped, as I think this is a platform-specific, or configuration-specific issue, where Mac OS and Linux Apache installations are set up for .so AKA 'shared-object' modules. Looking for a .c module shouldn't break the conditional, I think that's a bug, but it's the issue.

Try any of these and I hope something will help you as it did to me.

查看更多
贪生不怕死
3楼-- · 2020-03-30 04:42

Ok, I have to edit the answer, because despite everything worked fine, the problem appeared again. So, this time I dug deeper only to find out, that the problem were laying in my mod secure conf, so I had to set SecRuleEngine from On to DetectionOnly, and now the issue is gone. Previously it was detecting every attempt to update the post like an XSS attack.

查看更多
登录 后发表回答