Create Storage link on Shared Hosting
1. Normally use php artisan storage:link if use have ssh access
if php artisan doesnot work then manully
ln -s /home/u301157799/domains/opsmaihar.in/public_html/storage/app/public/posts /home/u301157799/domains/opsmaihar.in/public_html/public/storage
2.Create a file in your public_html file with a name (eg symlink.php) with the code below
< ?php
$linkName = '/home/username/public_html/innovativetechsolution.in/innovation/public/storage';
$target = '/home/username/public_html/mydomain.com/storage/app/public/myfolder1';
symlink($target, $linkName);
?>
3. Simplest one is
Route::get('/symlink', function () {
Artisan::call('storage:link');
});
Clearing CAhches on Shared Route::get('/clear-cache', function() {
Artisan::call('cache:clear');
return '<h1>Cache facade value cleared</h1>';
});
//Reoptimized class loader:
Route::get('/optimize', function() {
Artisan::call('optimize');
return '<h1>Reoptimized class loader</h1>';
});
//Route cache:
Route::get('/route-cache', function() {
Artisan::call('route:cache');
return '<h1>Routes cached</h1>';
});
Route::get('/config-cache', function() {
$exitCode = Artisan::call('config:cache');
return '<h1>Clear Config cleared</h1>';
});
env
APP_URL=https://innovativetechsolution.in ( Should be domain not like something.test
Comments
Post a Comment