laravel storage link in shared host

Laravel symbolic link in shared host

It’s not easy to deploy laravel applications in shared hosts. one of the problems after deploying laravel applications in shared hosts is make a symbolic link.

Laravel has a public disk to store the application uploaded files.

The public disk included in your application’s filesystems configuration file is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores its files in storage/app/public.

To make these files accessible from the web, you should create a symbolic link from public/storage to storage/app/public. 

For making the symbolic link you should run this command in the terminal.

php artisan storage:link

We don’t have access to the terminal in shared hosts but we have something called Cron Job.

With cron job, we can run some code per minute, daily, weekly, and …

We should set a cron job in Cpanel to create a symbolic link.

Cron Job in Cpanel

Open cron job in Cpanel and set a cron job per minute and use this command.



Leave a Reply

Your email address will not be published. Required fields are marked *