ilex01's avatar

symlink doesn't work

Here is my symlink file uploaded to public_html:

<?php
symlink('/home/girlz/storage/app/avatars', '/home/girlz/public_html/storage');

My pictures are stored there:

/girlz/storage/app/avatars
// picture1.jpg
// picture2.jpg

And I want to store them there:

/home/girlz/public_html/storage

The problem is that the files are not stored in /home/girlz/public_html/storage and I cannot access them. Even with the symlink.

0 likes
4 replies
Snapey's avatar

if you look in public_html/storage and do not see your files then your symlink is incorrect

Did you run the artisan storage:link command after creating the link?

Snapey's avatar

@ilex01 Sorry you don't need to run that command if you are using a php file to create the symlink

Did you delete/rename the public folder?

What you should really do is create a symlink from public_html to laravel's public folder and then store your avatars in storage/app/public/avatars

Please or to participate in this conversation.