Search code examples
wordpresscentosvps

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


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.


Solution

  • 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.