1
votes

Uploaded laravel project to production server with problem can't find storage folder in public_html can anyone help me ?

i have tried with php file to make symlink but it's not working

<?php
$targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public';
$linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage';
symlink($targetFolder,$linkFolder);
echo 'Work Done';
?>
2

2 Answers

0
votes

Use like this

$_SERVER['DOCUMENT_ROOT']."/ProjectName/FileName/../..
0
votes

If you have ssh access, You can run the given command to create a symlink, before running the command make sure you don't have any symlink already.

ln -s /home/USER/public_html/storage/app/public /home/USER/public_html/public/storage

For your reference, the syntax of the command is as ln -s source destination.

If you don't have access to ssh, You can do the same using cron job. Create a cron job with the above-given command and you'll get the symlink.