dsb12300 2015-12-27 03:57
浏览 51
已采纳

Symfony框架安装406不可接受的错误w / CPanel和WHM

So I am trying to get Symfony working on my server by following these install instructions.

http://symfony.com/doc/current/book/installation.html#book-installation-permissions

I got to the part where I ran this command in console in the directory where I wanted the framework to be installed.

symfony new my_project_name

I then followed these instructions to set my web root directory to /web as I believe I'm supposed to do?

It installed all the files correctly since I can see them in the folder. I made sure to restart apache and I'm positive document root is in the correct location.

http://tecadmin.net/how-to-change-document-root-of-primary-domain-in-cpanel/#

Once I did this I was supposed to be able to test the installation, but nothing seems to happen except that 406 error?

This is the exact error I get.

An appropriate representation of the requested resource /app.php could not be found on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I'm not sure what else to do.

Please note, that since I'm using CPANEL I can't change the virtual host configurations of apache if that is the issue, so I'm looking for a CPanel specific answer. Thank you!

  • 写回答

1条回答 默认 最新

  • douwen9534 2015-12-27 05:54
    关注

    Okay so I finally figured out what to do, I had 2 problems. Because I installed as the 'root' user I had to run the following command on the symfony installation.

    chown -R devdistribution:devdistribution .

    In my case, my username is devdistribution but you would just put your own. Make sure to do this on the top level not just the /web folder.

    I knew this was one of the errors because the apache log said something along these lines

    Mismatch between target UID (520) and UID (501) of file "/home/devdistribution/public_html/distribution_tech/web/app.php"

    This fixed the 500 error, but not the 406. To fix the 406 error you need to login into WHM and type modsecurity to find it in the search field.

    go to the configuration option for it, you will see this.

    Rules Engine SecRuleEngine 
    This setting controls the behavior of the rules engine.
     Process the rules.
     Do not process the rules.
     Process the rules in verbose mode, but do not execute disruptive actions.
    

    Select 'Do not process the rules'. Then save at the bottom. This fixed the issue for me and I was able to see the opening symfony screen!

    However, this I'm sure leaves security vulnerabilities now...so I still need help on the proper way to handle mod security with symfony in this case if anyone knows? I'll make a separate question for this.

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

报告相同问题?

悬赏问题

  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景