when i try to add new plugins and themes in wordpress centos 7 getting error message

Posted August 6, 2017 5.5k views
CentOSWordPressLAMP StackFirewall

I successfully installed all component for my own web server. Centos7

when i try to add new plugins and themes getting error message

Error : Plugins list An unexpected error occurred. Something may be wrong with or this server’s configuration. If you continue to have problems, please try the support forums. Try again

SELINUX=enforcing if Changes to *SELINUX=disabled * all are working fine

and i dnt want to disable SELINUX

image kink >>

this way i installed wordpress

adduser demo
passwd demo
gpasswd -a demo wheel

su - demo
sudo yum clean all
sudo yum update -y

sudo yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget -y

sudo systemctl start httpd
sudo systemctl start mariadb
sudo systemctl enable httpd
sudo systemctl enable mariadb

sudo mysqlsecureinstallation << Press enter

Set root password? [Y/n] y

New password: <– yourrootsqlpassword
Re-enter new password: <– yourrootsqlpassword

Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

mysql -u root -p

MariaDB [(none)]>CREATE DATABASE wordpress;
MariaDB [(none)]>GRANT ALL PRIVILEGES on wordpress.* to ‘user’@'localhost’ identified by 'password’;
MariaDB [(none)]>exit

tar -xzvf latest.tar.gz

sudo cp -avr wordpress/* /var/www/html/
sudo restorecon -r /var/www/html

sudo mkdir /var/www/html/wp-content/uploads
sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/

cd /var/www/html/
sudo mv wp-config-sample.php wp-config.php
sudo nano wp-config.php

define('DBNAME’, 'wordpress’);
USER’, 'user’);
define('DB_PASSWORD’, 'password’);

sudo firewall-cmd –permanent –zone=public –add-service=http
sudo firewall-cmd –permanent –zone=public –add-service=https
sudo firewall-cmd –reload

please help me to rectify the add new theme plugin error with out disabling SELINUX

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers


SELinux requires a little configuration and by default, will not allow Apache to write to files/directories. I’d recommend taking a look over the guide below as you’ll need to run a few commands to get things working properly while it’s enabled.


tried those still getting the same error .... no perfect tutorial available to configuring SELinux policies for apache ? iam new here and dnt hve linux skills please any one help