Closed brooksvb closed 5 years ago
Try changing
map: ./
To
map: /path/to/symfony-project
Then run
vagrant destroy && vagrant up
--
Versions
• Vagrant: 2.2.0 • Provider: Virtualbox 5.2.20 • Homestead: 8.4
Host operating system Windows 10 Homestead.yaml ip: 192.168.10.10 memory: 2048 cpus: 1 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys:
- ~/.ssh/id_rsa folders:
map: ./ to: /home/vagrant/code sites:
map: homestead.test to: /home/vagrant/code/public type: "symfony4" php: "7.3" databases:
- homestead name: brooks-codes hostname: brooks-codes Vagrant destroy & up output Gist Expected behavior After instantiating the homestead box, if I use composer require annotations and add a route annotation to my Symfony project, it should properly enable and use the route annotations. Actual behavior Installing annotations and adding an annotation-defined route does not get used by the Symfony application. It does not show up in bin/console router:debug output either. The default page is shown every time instead. Defining the routes with routes.yml does work, however. I haven't tested it extensively, but there seemed to be a similar issue with installing other Symfony packages, for example, the web debug toolbar not appearing after installing it. Steps to reproduce
- Start with fresh Symfony project
- Install homestead via Composer on host machine
- vagrant up
- vagrant ssh
- Run composer require annotations in the project directory
- Add a default controller with a route defined by annotation
- Attempt to visit that route in browser OR run bin/console debug:router in the project directory
References
• StackOverflow question
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I made this change and it didn't change behavior at all.
I'm using Homestead on a per-project-basis, which is why it was a relative path rather than absolute.
Add the following to Homestead.yaml
and run vagrant destroy && vagrant up
(And save the output to another gist for us to see)
version: 7.2.1
This is now the second issue we've seen where really odd things are happening in the alpha base box. #1178 is the other
This fixed the issue. vagrant destroy && vagrant up
output gist
I tried to replicate this without issue. My concern is there is an undiscovered bug in the alphas causing this and #1178, however using Homestead 8.5.5
and box 8.0.0-alpha2
I'm unable to replicate it. I'm surprised 8.0.0-alpha2
works with 8.x
, I certainly wouldn't recommend it.
You were using Homestead 8.4
with the 8.0.0-alpha1
box. Following your steps, I created a new app, added homestead, added annotations, added a default controller and added another method. The routes work fine and show up in bin/console debug:router
as you'd expect.
DefaultController:
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
/**
* @Route("/", name="root")
*/
public function index()
{
return $this->render('default/index.html.twig', [
'controller_name' => 'DefaultController',
]);
}
/**
* @Route("/about", name="about")
*/
public function about()
{
return $this->render('default/about.html.twig', [
'controller_name' => 'DefaultController',
]);
}
}
vagrant@homestead-test:~/code$ bin/console debug:router
-------------------------- -------- -------- ------ -----------------------------------
Name Method Scheme Host Path
-------------------------- -------- -------- ------ -----------------------------------
_twig_error_test ANY ANY ANY /_error/{code}.{_format}
_wdt ANY ANY ANY /_wdt/{token}
_profiler_home ANY ANY ANY /_profiler/
_profiler_search ANY ANY ANY /_profiler/search
_profiler_search_bar ANY ANY ANY /_profiler/search_bar
_profiler_phpinfo ANY ANY ANY /_profiler/phpinfo
_profiler_search_results ANY ANY ANY /_profiler/{token}/search/results
_profiler_open_file ANY ANY ANY /_profiler/open
_profiler ANY ANY ANY /_profiler/{token}
_profiler_router ANY ANY ANY /_profiler/{token}/router
_profiler_exception ANY ANY ANY /_profiler/{token}/exception
_profiler_exception_css ANY ANY ANY /_profiler/{token}/exception.css
root ANY ANY ANY <href=>/
about ANY ANY ANY <href=>/about
-------------------------- -------- -------- ------ -----------------------------------
I have the exact same issue with Homestead 9.0.1 and Virtual Box 5.2.
I have the exact same issue with Homestead 9.0.1 and Virtual Box 5.2.
Virtualbox 5.2 is ancient. You should be using at least Virtualbox 6.0.0
It seems to be a problem with my Firewall, if I turn it off, everything works. Thanks for your help and sorry to bother you.
@creacheck no worries! glad you got it sorted out.
Versions
Host operating system
Windows 10
Homestead.yaml
Vagrant destroy & up output
Gist
Expected behavior
After instantiating the homestead box, if I use
composer require annotations
and add a route annotation to my Symfony project, it should properly enable and use the route annotations.Actual behavior
Installing annotations and adding an annotation-defined route does not get used by the Symfony application. It does not show up in
bin/console router:debug
output either. The default page is shown every time instead. Defining the routes withroutes.yml
does work, however.I haven't tested it extensively, but there seemed to be a similar issue with installing other Symfony packages, for example, the web debug toolbar not appearing after installing it.
Steps to reproduce
vagrant up
vagrant ssh
composer require annotations
in the project directorybin/console debug:router
in the project directoryReferences