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条)

报告相同问题?

悬赏问题

  • ¥60 优博讯DT50高通安卓11系统刷完机自动进去fastboot模式
  • ¥15 minist数字识别
  • ¥15 在安装gym库的pygame时遇到问题,不知道如何解决
  • ¥20 uniapp中的webview 使用的是本地的vue页面,在模拟器上显示无法打开
  • ¥15 网上下载的3DMAX模型,不显示贴图怎么办
  • ¥15 关于#stm32#的问题:寻找一块开发版,作为智能化割草机的控制模块和树莓派主板相连,要求:最低可控制 3 个电机(两个驱动电机,1 个割草电机),其次可以与树莓派主板相连电机照片如下:
  • ¥15 Mac(标签-IDE|关键词-File) idea
  • ¥15 潜在扩散模型的Unet特征提取
  • ¥15 iscsi服务无法访问,如何解决?
  • ¥15 感应式传感器制作的感应式讯响器