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.

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

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作