Fixed Wordpress plugin install Could not create directory

In this tutorial, you'll learn how to fix the "Could not create directory" error during WordPressWordPress plugin installation. The setup involves using Nginx, PHP 7.4, and WordPress on Ubuntu 21.04. The error usually arises due to incorrect directory permissions. 

To resolve it, you need to adjust the ownership and permissions of the wp-content directory to ensure the web server can write to it. By following the provided steps, you can ensure seamless plugin installation and a smooth WordPress experience.

After install and configure wordpress completed. I have update plugin and could not create directory. I installed into a wordpress directory in /var/www . Nginx does not have permissions to write to the wp-content directory.

Wordpress plugin SEO Error

Installing Plugin: SEO 17.0 Downloading install package from…

Unpacking the package…

Could not create directory.

How to do it Fixed

Step 1: Getting the connection information

Create new file whoami.php into /var/www/ directory. For example, the content as below

root@localhost:~# cat /var/www/
<?php echo(exec("whoami")); ?>
Curl url or type domain in browser as below 

root@localhost:~# curl


Step 2: Change owner of the wordpress directory to user in shown with whoami.php. Example my user is huupv

sudo chown -R huupv:www-data /var/www/
Note: Ubuntu use www-data user of Nginx server.

Step 3: Change permisstion for wordpress directory

sudo find /var/www/ -type d -exec chmod 0755 {} \;
sudo find /var/www/ -type f -exec chmod 0644 {} \;


Fixing the "Could not create directory" error during WordPress plugin installation involves ensuring proper permissions for the wp-content directory. By identifying the correct user running your web server and adjusting the ownership and permissions of the WordPress directory, you can resolve this issue efficiently. These steps are essential for maintaining a smooth and functional WordPress environment, especially when using servers like Nginx. thank you for reading the page!


Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6