简体   繁体   English

Symfony 2 Mac Apache和Prod环境

[英]Symfony 2 Mac Apache and Prod environment

I am unable to get Symfony 2.x running in the prod environment on my MacBook. 我无法在MacBook的产品环境中运行Symfony2.x。

localhost/app_dev.php runs fine and check.php etc but not prod. localhost/app_dev.php运行正常,而check.php等运行正常,但不是prod。

I have tried all the usual fixes, such as chmod -R 777 , 775 etc on my /Users/user/Sites folder. 我已经在/Users/user/Sites文件夹中尝试了所有常规修复程序,例如chmod -R 777 775等。 I have chown the folder to _www:_www recursively as well. 我也递归地将文件夹添加到_www:_www I have also tried adding FollowSymLinks and Allowoverride to VHOSTs and my user conf in Apache. 我还尝试将FollowSymLinksAllowoverride添加到VHOST和Apache中的用户conf。 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. 日志文件中没有错误(symfony prod和apache),没有任何错误。

Like I said though… dev environment works fine. 就像我说的...开发环境很好用。 On my Windows and Linux machines both environments work perfectly, only problems on the Mac. 在我的Windows和Linux机器上,两种环境都可以完美运行,而在Mac上则只有问题。

UPDATE: With a bit of debugging, I found that app.php is being called, but it seems to "crash" at the following line 更新:经过一点调试,我发现正在调用app.php,但似乎在以下行“崩溃”了

$response = $kernel->handle($request);

Well, Symfony is a PHP framework correct? 好吧,Symfony是PHP框架正确吗? My first suggestion is to not deal with the built in Mac OS X Apache/PHP setup & instead use MAMP . 我的第一个建议是不处理内置的Mac OS X Apache / PHP设置,而是使用MAMP It's a self contained Mac version of a LAMP (Linux, Apache, MySQL & PHP) environment. 它是LAMP(Linux,Apache,MySQL和PHP)环境的自包含Mac版本。 And it is far more on par with the real world of web development than Apple's built-in tools go. 与苹果内置工具相比,它与Web开发的现实世界相提并论。

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喜欢这样:

curl -I localhost/app_dev.php

Or like this: 或像这样:

curl -I localhost/check.php

Also, are you checking the Apache & PHP logs? 另外,您是否正在查看Apache和PHP日志? 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. 就目前而言,让您重回正轨的最佳建议是使用MAMP而不是这种类型的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM