Dhairya Lakhera
Dhairya Lakhera

Reputation: 4808

laravel create symlink in custom public path

I have deployed my laravel application on shared hosting. I have moved all my filed and folders from public directory to public_html.

This is my directory structure

my-laravel-folder
public_html
  index.php

Now i am trying to create symlink in public_html using command php artisan storage:link. but this command create symlink in public directory.

what should i do to create symlink in public_html using command php artisan storage:link ?

Upvotes: 0

Views: 1199

Answers (1)

Tushar Kadus
Tushar Kadus

Reputation: 11

You can follow below steps to create a symlink

First go to root directory of file system by running this command

cd /

Then run this command

ln -s /path-to/my-laravel-folder/storage/app/public /path-to/public_html/storage

I faced the same problem on Hostinger and I was able to fix this by running the following command in the root directory.

ln -s /home/MY_USERNAME/domains/MY-DOMAIN.COM/my-laravel-folder/storage/app/public /home/MY_USERNAME/domains/MY-DOMAIN.COM/public_html/storage

Upvotes: 1

Related Questions