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

August 6, 2017 2.7k views
CentOS WordPress LAMP Stack Firewall

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 WordPress.org 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 >> http://s20.pixxxels.org/dn042stwt/Capture.4674567_PNG.png

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

wget http://wordpress.org/latest.tar.gz
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

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

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!