Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nacha's avatar
Level 2

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

0 likes
17 replies
nacha's avatar
Level 2

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

Amaury's avatar

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 ?

Sti3bas's avatar

@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');
});
nacha's avatar
Level 2

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

nacha's avatar
Level 2

add the route in web.php or where

nacha's avatar
Level 2

and where add this use Illuminate\Support\Facades\Artisan;

Sti3bas's avatar

@nacha add it to web.php, then visit it in the browser your-domain.com/create-symlink.

cookie_good's avatar

If you do it correctly, AWS ec2 is free for a year. Real quality product.

nacha's avatar
Level 2

error :

ErrorException (E_WARNING)
putenv() has been disabled for security reasons
putenv('LINES='.$this->terminal->getHeight());
Sti3bas's avatar

@nacha what about:

Route::get('create-symlink', function() {
    app('files')->link(storage_path('app/public'), public_path('storage'));
});
nacha's avatar
Level 2

error

symlink() has been disabled for security reasons
nacha's avatar
Level 2
 */
    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));
    }
nacha's avatar
Level 2

thank you thank you very much for your help

2 likes
jlrdw's avatar

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.