There really is no permanent way if the parent directory of the stored location isn't set to give full
read-write-execute. I am not really sure what
/Applications holds so depending on what it has, there might not be a permanent way. You'll always need to change it every time you create new files. Reason why I say that is because certain folders by default need to have a certain permission set. If the permission is wrong, your file system gets corrupted or you won't be able to properly use your system. So if
Applications has files in there by default, I suggest not touching them so changing permissions for
/Applications cannot be done. However, changing permissions on
/Applications/XAMPP is possible. However, this means that every time you create new files, the new files will by default have
/Applications permission. It won't have
/Applications/XAMPP permission since the actual parent isn't
/Applications/XAMPP. Well it is, but it goes by the initial first directory that within the file system which is
/Applications. Basically, when you create new files, you'll also have to apply the same permissions to them in order to get that full access that you want. Since we are only dealing with this locally, you can set the permission to
777. It wouldn't really matter. When you upload it to a live server, I suggest not setting the permissions like that because anyone can execute and overwrite your files. When we do it locally, unless if your computer is compromised or someone is using your network and hacked into your
Mac, setting the permissions we want wouldn't really matter.
So the command usually refers to
chmod since it is used for changing permissions. We'll also need to run this command using root permissions or it won't work. Then, we'll add in the
-R flag which means
recursive. This in turn will apply the same permissions on all sub-files and sub-directories. Then, we define the amount of permissions we want, in this case, we will set it to
0777. And last, we define which directory to set the permissions on. So, the command looks like this
sudo chmod -R 0777 /Applications/XAMPP
Then, you'll need to enter your password for your current account so that you can have root permission.
Check the permission on that directory afterwards. I suggest changing the directory in the terminal to
/Applications/XAMPP first. The final commands will be
sudo cd /Applications/XAMPP
This will basically do just exactly what I explained.
ls -l will show every file within
/Applications/XAMPP and show what permissions those files and directories have. You should see that they all have
read-write-execute permissions including
/Applications/XAMPP. Refresh your
localhost and it should be working.
That is correct.
Mac both share the same hierarchy because
unix. It runs
bash just like
Linux does and has very similar commands that
Linux has. However, not all commands that
Linux has are available on