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.

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

报告相同问题?

悬赏问题

  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历