I did a bit of Googling to find a resolution. To my luck, I found what is called a symbolic link, this is a special kind of file (entry) that points to the actual file or directory on a disk. Essentially this means that your projects will technically exist in this new folder which will reside in your Home folder, but XAMPP will treat it as if it were located within htdocs.
There are two types of links:
- symbolic links, Refer to a symbolic path indicating the abstract location of another file
- hard links, Refer to the specific location of physical data.
We will be using the symbolic link a.k.a soft link. My work generally resides in the Documents folder then I'd make subfolders. E.g., there is a folder for programming, a folder for University, a folder for Media and so on.
Creating a symbolic link
-s, make symbolic links instead of hard links
sudo -s <directory that must be linked> <directory that is linked to>
sudo -s <target file> <symbolic file>
Creating a symbolic link
-s, make symbolic links instead of hard links
sudo -s <directory that must be linked> <directory that is linked to>
sudo -s <target file> <symbolic file>
Type in:
sudo ln -s /home/banele/Documents/programming/php/Projects/PHPExcelLibrary /opt/lampp/htdocs
Enter your password when prompted. This is all it takes to create the symbolic link. We use sudo because of the htdocs permissions. For most symbolic links you create in Ubuntu it is not necessary.
Extra bonus I also created a symbolic link for the php file for the system variables.
sudo ln -s /opt/lampp/bin/php /usr/bin/php
Removing a symbolic link
You can remove existing links attached to files or directories by the unlink or rm command.
sudo ln -s /home/banele/Documents/programming/php/Projects/PHPExcelLibrary /opt/lampp/htdocs
Enter your password when prompted. This is all it takes to create the symbolic link. We use sudo because of the htdocs permissions. For most symbolic links you create in Ubuntu it is not necessary.
Extra bonus I also created a symbolic link for the php file for the system variables.
sudo ln -s /opt/lampp/bin/php /usr/bin/php
Removing a symbolic link
You can remove existing links attached to files or directories by the unlink or rm command.
- unlink <system link name to remove> unlink /home/banele/Documents/programming/php/Projects/PHPExcelLibrary
- rm <system link name to remove> rm /home/banele/Documents/programming/php/Projects/PHPExcelLibrary
No comments:
Post a Comment