INSTALLING CakePHP的傻瓜UPDATE CakePHP的 - 所请求的URL不在此服务器
如果你像我一样,你感到沮丧与这些框架,如Ruby on Rails和CakePHP的,其承诺的快速发展,尽管低迷开始上找到 - 只需花几个小时安装。
为了让CakePHP运行,扔掉教程,甚至不打扰购买书籍或阅读文档。他们没有提及确切地做到这一点,但是这是什么需要在Mac 10.6.2完成:
1) Install CakePHP to Sites and unzip it. Rename it to your application name.
2) Now your httpd.conf file can be located anywhere on your mac. Each tutorial assumes it's located at some place in the depths of virtual reality. But in reality all you need to do is use the handy unix command locate from the terminal: locate httpd.conf
4) Then whip out your editor: mate httpd.conf
5) make sure your DocumentRoot says this: DocumentRoot "/Library/WebServer/Documents"
6) make sure under Directory it says AllowOveride All and Allow from all. It should have this by default but you never know when your sister randomly screws with your computer. Just be glad you have a mac and don't have to deal with her infesting your computer with viruses.
7) Obviously you want the php module uncommented: LoadModule php5_module libexec/apache2/libphp5.so
8) Now if you're like me, you dont want to type http://localhost/~jmerlino/mysite. You want to type http://localhost/mysite. So launch the hosts file. Again all you have to do is locate /etc/hosts and then mate /etc/hosts, assuming you're using TextMate. If you're using BBEdit, then obviously you won't be using the mate command.
9) Add this line: 127.0.0.1 localhost/mysite. This allows you to now use http://localhost/mysite.
10) Now the crazy part. find yur username.conf. For me, it's /etc/apache2/users/username.conf. For you, you do locate and make sure it's same spot.
11) Add the following:
<VirtualHost *:80>
ServerName localhost/sitename
DocumentRoot "/Users/username/Sites/"
</VirtualHost>
12) Don't put username. Put whatever your user name is.
13) Then run your app off http://localhost/mysite.
14) Don't forget to sudo apachectl restart when you're finished.
如果你有问题了,这并不意味着你应该放弃编程,成为一个管道清洁剂。只要不断尝试。请记住,您无法在一个在线教程中找到解决方案。
尝试从“DocumentRoot”设置中删除“app/webroot”?或者那些文件夹实际存在? – drudge 2010-10-22 23:33:13
我曾尝试将其从DocumentRoot设置中移除。奇怪的是,错误依然存在。是的,这些文件确实存在。我在另一个浏览器上尝试过,因为我认为cookie可能是问题。我也重启了apache。但仍然存在同样的错误,尽管从documentroot删除app/webroot。 – JohnMerlino 2010-10-22 23:43:08