How to create symbolic link in cPanel?

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:

 <?php

$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.

  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Artículos Relacionados

How to change MX records in Cpanel

You can check and change MX records for domains pointed to our hosting nameservers following...

How do I change my account password in Cpanel?

1. Click on 'Change Password' under the 'Site Management' header in Cpanel. 2. Enter your...

How to run Python scripts?

If you wish to run Python scripts in your hosting account, you can create and edit them in two...

I lost my control panel username and password what should I do?

If you have forgotten your username or password to the online Control Panel, please check your...

How do I update my contact information in c Panel?

To update your contact information in cPanel, you can use the Update Contact Information feature...

Powered by WHMCompleteSolution