Homestead: Fatal error: Cannot redeclare static Symfony\Component\Console\Command\Command::$defaultName as non static Laravel\Homestead\MakeCommand::$defaultName in /Users/torerudlang/.composer/vendor/laravel/homestead/src/MakeCommand.php on line 155

Created on 15 Apr 2018  ·  6Comments  ·  Source: laravel/homestead

Please note that the Homestead issue tracker is reserved for bug reports and enhancements. We are not always able to debug Vagrant, Provider or Operating System issues, but will do our best to help. Thank you!

Versions

  • Vagrant: Run vagrant -v to show the version.
  • Provider: Virtualbox, VMWare or Parallels and its version.
  • Homestead: Run homestead --version to show the version.

A lot of issues can be resolved by simply updating vagrant, provider or homestead.

Note: Virtualbox users, please upgrade to ~5.2. You will show as up-to-date from the ~5.0 version when you About -> Check for Updates. You'll need to download a newer version of Virtualbox.

Host operating system

This is the operating system that you run locally.

Homestead.yaml

# Copy-paste your Homestead.yaml here

Vagrant destroy & up output

Provide a link to a GitHub Gist containing the complete output of vagrant destroy && vagrant up.
Do NOT paste the debug output in the issue, just paste the link to the Gist.

Expected behavior

What should have happened? Please include as much detail as possible.

Actual behavior

What actually happened? Please include as much detail as possible.

Steps to reproduce

1.
2.
3.

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

  • GH-1234
  • ...

Most helpful comment

I am getting that error on a totally fresh install when I first try to run homestead init in terminal (from this Laravel's installation page).

What solved the issue was doing this (from Laravel #19088):
In a text editor, open the file /Users/user/.composer/vendor/laravel/homestead/src/MakeCommand.php
Find and replace “default” with nothing (changing all of the “defaultName”s to “Name” throughout the file).

Once I did that, homestead init ran successfully.

All 6 comments

Sounds like an old version of Homestead. Make sure you're running 7.3.0.

I am getting that error on a totally fresh install when I first try to run homestead init in terminal (from this Laravel's installation page).

What solved the issue was doing this (from Laravel #19088):
In a text editor, open the file /Users/user/.composer/vendor/laravel/homestead/src/MakeCommand.php
Find and replace “default” with nothing (changing all of the “defaultName”s to “Name” throughout the file).

Once I did that, homestead init ran successfully.

same here
what's wrong with this command ?

@kylehyperlink and @Roron0a this issue was fixed in https://github.com/laravel/homestead/pull/682 and released in v6.3.0

Just make sure that you're running the latest version of Homestead.

Hi! I'm facing this problem again, but I'm not sure if it's that same problem or the conflict problem from 3.4.x-dev version, presented at #682, which would be very strange. When I run "homestead" line, I face the following error:

PHP Fatal error: Cannot redeclare static Symfony\Component\Console\Command\Command::$defaultName as non static Laravel\Homestead\MakeCommand::$defaultName in /home/att4ck3rs3cur1ty/.config/composer/vendor/laravel/homestead/src/MakeCommand.php on line 155

the command 'composer show symfony/console | grep version' shows that its version is v4.2.3

PHP version: 7.1.17

Following @kylehyperlink's directions worked for me even in Feb 2020 with a fresh install. Weird, but works.

Was this page helpful?
0 / 5 - 0 ratings