21 December, 2019

Symbolic link in shared hosting in a Laravel application | Error Solved for php artisan storage:link

Add this on your register method of AppServiceProvider.php to run php artisan storage:link on your Shared hosting cPanel in a Laravel Application to make a symbolic link.




// Inside of AppServiceProvider.php register() method: 
$this->app->bind('path.public', function() { return base_path('../public_html'); });
Or you can write this kind of script:
// Create a GET route and run this script to make the symlink.
<?php>
symlink('/home/CpanelUser/storage/app/public', '/home/CpanelUserpublic_html/storage');
?>

No comments:

Post a Comment