CakePHP 2.2.2 not working on Windows IIS7

半城伤御伤魂 提交于 2019-11-30 20:07:36

问题


I am trying to make CakePHP work over windows with IIS7 and i can not get it following the official documentation: http://book.cakephp.org/2.0/en/installation/advanced-installation.html#url-rewrites-on-iis7-windows-hosts

I have downloaded the rewrite module for IIS7 from here: http://www.microsoft.com/en-us/download/details.aspx?id=7435 And then installed it as admin.

I created the web.config file inside my cakephp main folder as said on the documentation.

The result I'm having is that when i try to load my cakephp main folder with the browser, it tries to load the wellcome.png image of IIS7 (failing to load it) and it doesn't load any project or cakephp content.

If i remove the web.config file from my mail folder, cakephp loads but it shows the the following error:

URL rewriting is not properly configured on your server.    
1) Help me configure it 
2) I don't / can't use URL rewriting

What am I doing wrong? Any idea? Thanks.


回答1:


Ok, i have it working now.

What i had to do, after downloading and installing the rewrite module for IIS7 ( http://www.microsoft.com/en-us/download/details.aspx?id=7435 )

  • Create a new Site in IIS pointing to the CakePHP project folder
  • Import and Apply the .htaccess files using the URL Rewrite Module
    • APP\webroot\.htaccess
    • APP\.htaccess

That's it. Hope this can help anyone :)



来源:https://stackoverflow.com/questions/12492078/cakephp-2-2-2-not-working-on-windows-iis7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!