dp19001 2013-11-21 15:16
浏览 47
已采纳

Symfony 2 Mac Apache和Prod环境

I am unable to get Symfony 2.x running in the prod environment on my MacBook.

localhost/app_dev.php runs fine and check.php etc but not prod.

I have tried all the usual fixes, such as chmod -R 777, 775 etc on my /Users/user/Sites folder. I have chown the folder to _www:_www recursively as well. I have also tried adding FollowSymLinks and Allowoverride to VHOSTs and my user conf in Apache. but still no luck.

The "error" I get is....

The connection was reset

The connection to the server was reset while the page was loading.

Nothing more, nothing less. No errors in the log files (symfony prod & apache), nothing.

Like I said though… dev environment works fine. On my Windows and Linux machines both environments work perfectly, only problems on the Mac.

UPDATE: With a bit of debugging, I found that app.php is being called, but it seems to "crash" at the following line

$response = $kernel->handle($request);
  • 写回答

1条回答 默认 最新

  • duanpu5048 2013-11-21 15:30
    关注

    Well, Symfony is a PHP framework correct? My first suggestion is to not deal with the built in Mac OS X Apache/PHP setup & instead use MAMP. It’s a self contained Mac version of a LAMP (Linux, Apache, MySQL & PHP) environment. And it is far more on par with the real world of web development than Apple’s built-in tools go.

    That said, to diagnose your current setup, I think you should check headers from the requests you are making to see what is truly happening. You would do this using curl -I like this:

    curl -I localhost/app_dev.php
    

    Or like this:

    curl -I localhost/check.php
    

    Also, are you checking the Apache & PHP logs? Might glean more clues from those. As it stands, my best recommendation to get you back on track is to use MAMP instead of this type of setup.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装