0

I am new to wordpress. I installed XAMPP server & wordpress successfully on my Ubuntu machine but I am not able to install any plugin or theme as it giving error that: Installation failed: Could not create directory. /opt/lampp/htdocs/wordpress/wp-content/upgrade

I tried to give permission to the directory as per this StackOverflow answer but still no solution.

My root directory is: /opt/lampp/htdocs/wordpress

My htdocs permission directory looks something like this: enter image description here

Does anyone know what am I doing wrong? and how can I fix it?

1 Answers1

1

It is absolutely true that permissions are a pain in the neck on Ubuntu XAMPP.

Try doing this:

cd /var/www/whatever-your-home-directory-is
sudo chown -R www-data:www-data .
sudo find . -type f -exec chmod a+w {} \;
sudo find . -type d -exec chmod a+wx {} \;

Then, when doing stuff to files from your shell, precede your commands with sudo -u www-data. For example, to delete the debug log file do this.

sudo -u www-data rm wp-content/debug.log
O. Jones
  • 103,626
  • 17
  • 118
  • 172