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 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记