How to create symbolic link in cPanel? Print

  • 0

Symlinks - short for symbolic links are basically shortcuts to individual files or folders. One of the advantages of the symlink is that it can cross file systems, as it references abstract filenames/directories, not physical locations.

 There are two ways to create symlink in cPanel:

 1. It can be created via cronjob using the command:

ln -s /path/to/target /path/to/shortcut

 NOTE: make sure to delete the cronjob once the symlink has been created.

2. You can also create symlink using PHP function.

 The example of the script can be found below:


$target = '/home/cPanelusername/public_html/index.html';

$shortcut = 'script.html';

symlink($target, $shortcut);


Just run this PHP file in the browser and it will create symlink right away.

Was this answer helpful?

« Back