@nacha SSH access is only available for Premium plan: https://www.000webhost.com/upgrade
how to run command php artisan storage :link in 000webhost?
when I try to upload image in 000webhost there's no image how to fix that because if I try to upload image in local server the image not display but when type php artisan storage: link I can see the image help please thank you
thank you can I do it with cron job ? if I can't there is another solution or the only solution is upgrade thank you veeery much
The artisan storage:link create a symbolic link from public/storage to storage/app/public.
I don't know 000webhost features, but maybe with a cPanel if it is provided you may create this symbolic link ?
@nacha try to add a route and then access it from the browser:
use Illuminate\Support\Facades\Artisan;
//...
Route::get('create-symlink', function() {
Artisan::call('storage:link');
});
I have storage in public because I run storage:link in local server and I have storage in public_html in 000webhost also but when I upload image there's no image to display that's the problem and can't run command sotarge:link
add the route in web.php or where
and where add this use Illuminate\Support\Facades\Artisan;
@nacha add it to web.php, then visit it in the browser your-domain.com/create-symlink.
If you do it correctly, AWS ec2 is free for a year. Real quality product.
error :
ErrorException (E_WARNING)
putenv() has been disabled for security reasons
putenv('LINES='.$this->terminal->getHeight());
@nacha what about:
Route::get('create-symlink', function() {
app('files')->link(storage_path('app/public'), public_path('storage'));
});
error
symlink() has been disabled for security reasons
@nacha it means that you cannot do it without SSH access.
*/
public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link);
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} ".escapeshellarg($link).' '.escapeshellarg($target));
}
thank you thank you very much for your help
@nacha how did you do it? can you share for us please?
For a small site like webhost just store images in public.
Example somesite/uploads/images
Or whatever folder.
I would only use that for learning I would not put a customer's data on there.
Please or to participate in this conversation.