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

hapiiis's avatar

Storage link not working in shared hosting

I try to create symlink in shared hosting but it returns like this. How to fix it?

$ php artisan storage:link

   Error

  Call to undefined function Illuminate\Filesystem\symlink()

  at vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:335
    331▕      */
    332▕     public function link($target, $link)
    333▕     {
    334▕         if (! windows_os()) {
  ➜ 335▕             return symlink($target, $link);
    336▕         }
    337▕
    338▕         $mode = $this->isDirectory($target) ? 'J' : 'H';
    339▕

      +14 vendor frames
  15  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
0 likes
2 replies
zubair2201's avatar

Hi Hapiiis, hope you find a solution if not kindly use a symbolic link Find an example below

Step 1. ln -sf target path (/var/www/html/...) link path (/var/www/html/...)

Step 2. Rename public->/storage/app/public to storage->/storage/app/public The issue will be fixed

Please or to participate in this conversation.