Xampp htdocs folder, sub folders and all files permission

I am not familiar with Ubuntu. I copied my project folder in htdocs, then I open my project in browser it loads, but styling files (CSS files) don't load. It is a permission problem. I have done a lot of commands but didn't have any success.

How can I give permission to each and every thing in htdocs?


You need to change permissions or ownership of htdocs directory. To change the permissions use the chmod command, for example:

$sudo chmod -R 755 /opt/lampp/htdocs

To see who is currently logged user, run:

$whoami

To change the owner use the chown command:

$sudo chown -R username:username /opt/lampp/htdocs

Also, you can use find command to change the permissions only on specific files. For example, to change the permissions on all css files in htdocs directory run the following command:

sudo find /opt/lampp/htdocs -type f -name "*.css"  -exec chmod 755 {} \;

sudo chown -R daemon wordpress-folder

// or use htdocs folder

the xampp apache server uses a user named daemon to access the folders inside htdocs, this will fix all the permission problems.