duanping3587 2015-07-22 12:31
浏览 218
已采纳

找不到 - 在此服务器上找不到请求的URL / app / example

I have followed the tutorial to get started with Symfony

https://symfony.com/doc/current/quick_tour/the_big_picture.html

and I have first set up a development environment using Vagrant: I created the virtual machine Ubuntu, and it seems that the files in the virtual machine are synchronised with my current Symfony project directory.

When I try to start the server locally from the project folder with the following command:

php console server:run

or (depending on my current directory)

php app/console server:run

I get the following error/warning:

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: date_default_timezone_get(): It is not safe to rely on the system'
s timezone settings. You are required to use the date.timezone setting or
the date_default_timezone_set() function. In case you used any of those me
thods and you are still getting this warning, you most likely misspelled th
e timezone identifier. We selected the timezone 'UTC' for now, but please s
et date.timezone to select your timezone.

But apparently this is not a problem, and it is not my actual problem.

I have associated the port 80 of the virtual machine with the port 4567 in my local computer, as explained in the tutorial of Vagrant, by typing the following command in the Vagrantfile:

config.vm.network :forwarded_port, guest: 80, host: 4567

Now, in the Symfony tutorial I am following, to see the initial page, I have to type the following command in the browser URL entry box:

http://localhost:8000/app/example

But it does not work, because of course I need to use another port, so I try with:

 http://localhost:4567/app/example

and I get the following page:

enter image description here

  • 写回答

1条回答 默认 最新

  • dongsi2317 2015-07-22 14:35
    关注

    I was receiving the following error/warning:

    [Symfony\Component\Debug\Exception\ContextErrorException] Warning: date_default_timezone_get(): It is not safe to rely on the system' s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those me thods and you are still getting this warning, you most likely misspelled th e timezone identifier. We selected the timezone 'UTC' for now, but please s et date.timezone to select your timezone

    When I run the following command on the terminal:

    php app/console server:run
    

    I decided to try to fix this error/warning, and at the end it started working.

    I fixed that warning by following the instructions of the second part of the following answer:

    https://stackoverflow.com/a/20743237/3924118

    To the question

    Symfony2 and date_default_timezone_get() - It is not safe to rely on the system's timezone settings

    But strangely, I need to use the original port 8000, instead of 4567:

    http://localhost:8000/app/example
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么