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

Galavant's avatar

symlink input/ouput error.

I'm running on homestead. I've used vagrant up

vagrant ssh

and i've used the following command

php artisan storage:link

this error is given and I can't seem to figure out why.

I am running Bash as admin. I am ssh'd into vagrant. I am in the right directory.


 ErrorException  : symlink(): Input/output error

  at /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:228
    224|      */
    225|     public function link($target, $link)
    226|     {
    227|         if (! windows_os()) {
  > 228|             return symlink($target, $link);
    229|         }
    230|
    231|         $mode = $this->isDirectory($target) ? 'J' : 'H';
    232|

  Exception trace:

  1   symlink("/home/vagrant/code/lsapp/storage/app/public", "/home/vagrant/code/lsapp/public/storage")
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:228

  2   Illuminate\Filesystem\Filesystem::link("/home/vagrant/code/lsapp/storage/app/public", "/home/vagrant/code/lsapp/public/storage")
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php:35

  3   Illuminate\Foundation\Console\StorageLinkCommand::handle()
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29

  4   call_user_func_array([])
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29

  5   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87

  6   Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31

  7   Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Container/Container.php:564

  8   Illuminate\Container\Container::call()
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Console/Command.php:184

  9   Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      /home/vagrant/code/lsapp/vendor/symfony/console/Command/Command.php:251

  10  Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Console/Command.php:171

  11  Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/vendor/symfony/console/Application.php:886

  12  Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Foundation\Console\StorageLinkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/vendor/symfony/console/Application.php:262

  13  Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/vendor/symfony/console/Application.php:145

  14  Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Console/Application.php:89

  15  Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122

  16  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /home/vagrant/code/lsapp/artisan:37
0 likes
9 replies
D9705996's avatar

What operating system are you running homestead on?

D9705996's avatar

Can you try manually creating the symlink using

ln -s /home/vagrant/code/lsapp/public/storage /home/vagrant/code/lsapp/storage/app/public

If this fails then can you check the current logged into user by running the id command and the file permissions ls -lh /home/vagrant/code/lsapp/ and show the output

Galavant's avatar

Hey @D9705996

The first command created the following error

ln: failed to create symbolic link '/home/vagrant/code/lsapp/storage/app/public/storage': Input/output error

The second command shows:

drwxrwxrwx 1 root root 8.0K Sep 25 08:19 app
-rwxrwxrwx 1 root root 1.7K Apr  4 06:13 artisan
drwxrwxrwx 1 root root    0 Apr  4 06:32 bootstrap
drwxrwxrwx 1 root root    0 Jul 12 07:19 chat
-rwxrwxrwx 1 root root 2.4K Sep 25 09:15 composer.json
-rwxrwxrwx 1 root root 212K Sep 25 09:15 composer.lock
drwxrwxrwx 1 root root 4.0K Jul  2 10:59 config
drwxrwxrwx 1 root root 4.0K May 18 09:34 database
-rwxrwxrwx 1 root root 1.2G Sep 21 13:15 lsapp.zip
drwxrwxrwx 1 root root 320K Sep 21 12:01 node_modules
-rwxrwxrwx 1 root root 1.8K Sep 21 12:01 package.json
-rwxrwxrwx 1 root root 788K Sep 21 12:01 package-lock.json
drwxrwxrwx 1 root root    0 Jun 29 12:53 phpMyAdmin
-rwxrwxrwx 1 root root 1.1K Jun 20 13:54 phpunit.xml
drwxrwxrwx 1 root root 4.0K Sep 21 09:14 public
-rwxrwxrwx 1 root root 3.6K Apr  4 06:13 readme.md
drwxrwxrwx 1 root root    0 May  2 12:56 resources
drwxrwxrwx 1 root root    0 Sep 21 11:58 routes
-rwxrwxrwx 1 root root  584 Apr  4 06:13 server.php
drwxrwxrwx 1 root root    0 May  8 06:33 storage
drwxrwxrwx 1 root root    0 Apr  4 06:32 tests
-rwxrwxrwx 1 root root 3.1K Jul  2 10:52 Vagrantfile
drwxrwxrwx 1 root root  12K Sep 25 09:14 vendor
-rwxrwxrwx 1 root root  564 Jun 26 12:37 webpack.mix.js
-rwxrwxrwx 1 root root 2.3K Jul  6 13:50 yarn-error.log
D9705996's avatar

can you please show the output of the id command. This should show you something like (obviously with you user and group details not mine!)

uid=0(admin) gid=0(administrators) groups=0(administrators),100(everyone)

Can you also just double check that when you do ls -lh /home/vagrant/code/lsapp/public just to make sure that a storage folder/symlink doesn't already exist

D9705996's avatar

Can I also just double check... are you using Windows anywhere in youre setup. Windows and symlinks don't play well

ewerkema's avatar

@d9705996 I am getting the same error as @galavant, my homestead is running on Ubuntu 18.04.1 LTS (Virtualbox) and my local machine runs on Windows Version 10.0.17134.590.

When running the id command I get the following result:

uid=1000(vagrant) gid=1000(vagrant) groups=1000(vagrant),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),108(lxd),113(lpadmin),114(sambashare)

I can generate the symbolic link on my Windows machine, but somehow this doesn't work for the virtual box. It looks like its pointing at an incorrect folder:

drwxrwxrwx 1 root root 4096 Mar  2 11:54 .
drwxrwxrwx 1 root root 8192 Mar  1 12:42 ..
drwxrwxrwx 1 root root    0 Feb  9 12:54 css
drwxrwxrwx 1 root root 4096 Feb  9 12:51 docs
-rwxrwxrwx 1 root root    0 Jul 27  2018 favicon.ico
drwxrwxrwx 1 root root 4096 Aug 15  2018 fonts
-rwxrwxrwx 1 root root  593 Aug 15  2018 .htaccess
drwxrwxrwx 1 root root 4096 Feb  9 13:55 images
-rwxrwxrwx 1 root root 1823 Jul 27  2018 index.php
drwxrwxrwx 1 root root    0 Feb  9 12:54 js
-rwxrwxrwx 1 root root   72 Mar  2 10:34 mix-manifest.json
-rwxrwxrwx 1 root root   24 Jul 27  2018 robots.txt
lrwxrwxrwx 1 root root    0 Mar  2 11:54 storage -> ../../storage/app/public
pge's avatar

I have the same problem, do you know what is bad ?

eliezer's avatar

I had the same problem of pointing to the wrong place, it only worked after I removed type: "nfs" from homestead.yaml

2 likes

Please or to participate in this conversation.