Xampp htdocs folder, sub folders and all files permission
Solution 1
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 {} \;
Solution 2
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.
Related videos on Youtube
Gammer
Updated on September 18, 2022Comments
-
Gammer over 1 year
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
? -
atom almost 6 yearswhoami works for me
-
user227495 over 5 yearsThe above helped me place wordpress folder and start installation. But the directory was not writable. I had to chmod777 before successfully complete the installation and using the directory inside wordpress.
-
Hrvoje T over 5 yearsI copied mypage.php to htdocs and it has rwx--x--- rights. I see xampp index.html has 644. Where do I set umask so when copying to htcdocs my files shange to 644 rights?
-
amdev about 5 yearsyou need to do a sudo -i before all