Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices for Resolving Permission issues Using XAMPP (LAMPP) on a Linux machine

Problem

I've recently started using Linux on one of my laptops. I installed XAMPP (LAMPP) which I'm very familiar with on the Mac and Window OS in order to develop my WordPress themes etc.

I keep running into annoying permission issues, which I understand is a part of the Linux learning curve. I'm not proficient using terminal commands.

Before doing anything I could not import my any Wordpress development files from my other computers without having access permission errors.

Using terminal I changed the permissions in the htdocs folder:

sudo chmod 777 -R /opt/lampp/htdocs

Which solved one problem, seemed like my WP files were recognized, but now I cannot connect to the database I created in phpMyAdmin, using the correct database name, root as the user and nothing for the password, which works fine when I create a WordPress installation from within this laptop.

I only get these issues when importing files into htdocs from a zip or otherwise.

Question

Is there a set of best practices for setting up XAMPP (LAMPP) on a Linux box so that there are no permission issues or other issues that get in the way of using a local installation for Wordpress (and other programs).

Thanks!

like image 362
jw60660 Avatar asked Nov 14 '22 17:11

jw60660


1 Answers

For best practices refer to the wordpress codex. [1] It is not very wise to assign 777 permissions to your files.

I would usually cd to the directory containing wordpress installation i.e. where wp-content, wp-admin and wp-includes exist. Then run the following commands

To set permissions for directories

find . -type d -exec chmod 755 {} \;

To set permissions for files

find . -type f -exec chmod 644 {} \;

[1]. http://codex.wordpress.org/Hardening_WordPress#File_permissions

like image 196
viyyer Avatar answered Dec 24 '22 21:12

viyyer