Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Randy_Johnson's avatar

Symlink to storeage folder in the public

Hi, I need to create a symlink from storage to public storage. The problem is is that my directories have changed because its on shared hosting. So I am unable to run php artisan storage:link.

The server is running linux. My folder structure is like this

[~/public_html/public]# 
./   .htaccess  css/       favicon.ico   index.php  phpinfo.php  storage/
../  TTobacco/  error_log  fontawesome/  js/        robots.txt   web.config
[~/public_html/public/website]# dir
./              .styleci.yml   ecommerce-backup.sql  routes/
../             app/           error_log             server.php
.editorconfig   artisan        node_modules/         storage/
.env            bootstrap/     package-lock.json     tests/
.env.example    composer.json  package.json          vendor/
.gitattributes  composer.lock  phpunit.xml           webpack.mix.js
.gitignore      config/        readme.md
.htaccess       database/      resources/

So I need to create the symlink from the public/website/storage to the public/storage.

Please help, I tried what was written in the google search but it just wasn't doing what I needed. I cannot see any of my images.

0 likes
5 replies
mohammadelkoumi's avatar

don't worry ... so easy tray to ssh@yourserver and run

ln -s /path/to/Laravel/storage/app/public /path/to/Laravel/public/storage

this will act same like

php artisan storage:link
1 like
Snapey's avatar
Snapey
Best Answer
Level 122

You realise that you risk the security of your site by putting the whole project in the public_html folder?

1 like
jlrdw's avatar

In shared I have:

....Laravelup  // main laravel here
....public_html
........laravel
............uploads
............css
............etc etc

That folder structure works fine for me.

Notice main laravel is out of Webroot. Images go in their folders under uploads. I use the asset helper to display.

See also http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

And

http://novate.co.uk/install-laravel-5-2-on-fasthosts-shared-hosting/

These are just examples each host is a little different. But get main laravel out of any public access above Web root.

Randy_Johnson's avatar

Okay I will move it. Snapey, is there anyway I can connect with you? Email?

Please or to participate in this conversation.