0

I am trying to set up a WordPress website on a VPS using Nginx with the following specifications:

CentOS 7
Nginx v1.12.2
PHP 7.2.2

The permissions and SELinux context of the html (Nginx root) folders and files:

html root folder: 755 / httpd_sys_content_t
folders in html: 755 / httpd_sys_content_t
files in html: 644 / httpd_sys_content_t
wp-content folder: 755 / httpd_sys_rw_content_t
wp-content files: 644 / httpd_sys_rw_content_t

Ownership:

everything: root:nginx

However, I cannot install any plugins from the dashboard. Specifically, I am trying to install the Thim Core plugin, and it is telling me that the plugin folder does not have the correct permissions. The next time I try to enter my wp-admin page, i get Unable to connect and the URL looks like this:

http://MY-IP/wp-admin/?thim-auto-compile-sass-to-css

I have used a day trying to get somewhere without success, so I turn to you. I really hope someone can point me in the right direction here!

Update:
I am not sure this is relevant, but my wp-config.php is in another directory with the same permission and context as the 'html root folder', and the file itself with the same permission and context as the 'files in html'. Also, I am running SELinux in permissive mode without luck.

  • So, what are the ownership of the files and folders? – Michael Hampton Feb 6 '18 at 18:48
  • The user is root and the group is nginx for absolutely everything. – Akitirija Feb 6 '18 at 18:49
  • Then that's why it doesn't work. – Michael Hampton Feb 6 '18 at 19:00
  • I'd like to curse now, but that is probably not a good idea here. Changed to nginx:nginx and everything works. God, I swear I tried that before. Apparently, I did not. A thousand thanks to you, Michael. – Akitirija Feb 6 '18 at 19:05
  • Please enter as detailed an answer as you can in the answer box below, then 24 hours later mark it as answered. That stops others coming into the question trying to help. – Tim Feb 6 '18 at 21:52
0

Thanks to the help I received from Michael Hampton, I tried changing the ownership for all folders and files to:

nginx:nginx

It now works perfectly.

The folder that contains the real wp-config.php file needs the same permission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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