dongliulu1122 2014-10-17 19:41
浏览 71
已采纳

PhpStorm + Vagrant + Symfony2

I want to display Symfony2 page using vagrant box. If i turn on vagrant box (vagrant up), and use by ssh command "php app/console server:run" Then i see info " Server running on http://127.0.0.1:8000 " and if i go to the website "192.168.33.10" or "127.0.0.1" or "127.0.0.1:8000" on host machine, Then i don't see symfony2 site.

Question: How is correctly configuration the vagrant file, that allow me see symfony2 site ?

Its keys lines in my vagrant file .

      ....
      config.vm.box = "symfony-v0.2.0"
      config.vm.network "forwarded_port", guest: 8000, host: 80
      config.vm.network "private_network", ip: "192.168.33.10"
      config.vm.network "public_network"
      config.vm.synced_folder "./", "/var/www/"
      ....

Add informations:
==> default: Mounting shared folders...
    default: /var/www => C:/Users/Wojtek/PhpstormProjects/DragonisProject/Symfony2Project
    default: /vagrant => C:/Users/Wojtek/PhpstormProjects/DragonisProject/Symfony2Project
  • 写回答

2条回答 默认 最新

  • dongmiao260399 2014-10-18 14:52
    关注

    Delete line config.vm.network "private_network", ip: "192.168.33.10" from Vagrantfile. Then start server server as php app/console server:run 0.0.0.0:8000 it will listen to all ip addresses and access it as http://localhost because you have port 8000 forwarded to port 80 on host machine.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Catia V5 R20 64位 安装过程中选择orbix配置创建套接字失败
  • ¥100 C51单片机设计交通灯时出现的问题
  • ¥15 R语言爬虫的时候元素和园代码不一样怎么解决呀
  • ¥15 VS2022多项目启动有问题
  • ¥15 SQL删除添加数据后序号不连续问题。
  • ¥15 首次运行OmniEvent运行报错
  • ¥15 有没有人知道这个问题怎么解决
  • ¥15 comsol电力电缆载流量仿真
  • ¥15 webSocket可以接TCP socket接口吗
  • ¥60 mpi并行出错,CFD++计算