简体   繁体   English

PhpStorm +流浪汉+ Symfony2

[英]PhpStorm + Vagrant + Symfony2

I want to display Symfony2 page using vagrant box. 我想使用无业游民的框显示Symfony2页面。 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. 如果我打开无业游民的盒子(无业游民),并通过ssh命令“ php app / console server:run”使用,那么我会看到信息“服务器在http://127.0.0.1:8000运行”,并且如果我转到网站主机上的“ 192.168.33.10 ”或“ 127.0.0.1 ”或“ 127.0.0.1:8000 ”,那么我看不到symfony2站点。

Question: How is correctly configuration the vagrant file, that allow me see symfony2 site ? 问题:如何正确配置流浪者文件,让我看到symfony2网站?

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

Delete line config.vm.network "private_network", ip: "192.168.33.10" from Vagrantfile. 从Vagrantfile中删除config.vm.network "private_network", ip: "192.168.33.10"config.vm.network "private_network", ip: "192.168.33.10" 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. 然后将服务器服务器启动为php app/console server:run 0.0.0.0:8000 ,它将侦听所有ip地址并以http://localhost访问,因为您已将端口8000转发至主机上的端口80。

1) Make sure you set your local host file to point your site to the correct vagrant IP (192.168.33.10), if applicable. 1)确保将本地主机文件设置为将站点指向正确的无业游民的IP(192.168.33.10)(如果适用)。 Otherwise just use the IP directly. 否则,直接使用IP。

2) If your vagrant instance is running, the issue is likely due to your apache conf within the vagrant box. 2)如果您的vagrant实例正在运行,则问题可能是由于您在vagrant框中的apache conf所致。

Make sure you have the proper Apahce/nginx vhost in place for your site. 确保为您的站点安装了正确的Apahce / nginx虚拟主机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM