更新CakePHP-在此服务器上找不到请求的URL

更新CakePHP-在此服务器上找不到请求的URL,php,apache,cakephp,http-status-code-404,Php,Apache,Cakephp,Http Status Code 404,为假人安装CAKEPHP 如果你像我一样,你会对RubyonRails和CakePHP这样的框架感到失望,尽管起步缓慢,但它们保证了快速开发——只需花几个小时安装 为了让CakePHP运行起来,扔掉教程,甚至不用费心买书或阅读文档。他们中没有人提到要做到这一点,但这正是在Mac 10.6.2上需要做到的: 1) Install CakePHP to Sites and unzip it. Rename it to your application name. 2) Now your httpd.

为假人安装CAKEPHP

如果你像我一样,你会对RubyonRails和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. 
1)将CakePHP安装到站点并解压缩。将其重命名为应用程序名。
2) 现在,您的httpd.conf文件可以位于mac上的任何位置。每个教程都假设它位于虚拟现实深处的某个地方。但实际上,您所需要做的就是从终端使用方便的unix命令locate:locate httpd.conf
4) 然后拿出你的编辑器:mate httpd.conf
5) 确保您的DocumentRoot显示:DocumentRoot“/库/WebServer/Documents”
6) 确保目录下显示AllowVeride All和Allow from All。默认情况下,它应该有这个功能,但你永远不知道你的妹妹什么时候会随意地用你的电脑乱动。很高兴你有一台mac电脑,而不必面对她用病毒感染你的电脑。
7) 显然,您希望php模块未注释:LoadModule php5_module libexec/apache2/libphp5.so
8) 现在,如果你像我一样,你不想打字http://localhost/~jmerlino/mysite。你想打字吗http://localhost/mysite. 所以启动hosts文件。同样,假设您使用的是TextMate,那么您所要做的就是定位/etc/hosts,然后匹配/etc/hosts。如果您使用的是BBEdit,那么显然您不会使用mate命令。
9) 添加此行:127.0.0.1 localhost/mysite。这允许您现在使用http://localhost/mysite.
10) 现在是疯狂的部分。查找yur username.conf。对我来说,是/etc/apache2/users/username.conf。对你来说,你必须找到并确保它是同一个地点。
11) 添加以下内容:
服务器名localhost/sitename
DocumentRoot“/用户/用户名/站点/”
12) 不要输入用户名。不管你的用户名是什么。
13) 然后运行你的应用程序http://localhost/mysite.
14) 完成后别忘了重新启动sudo apachectl。

如果您还有其他问题,这并不意味着您应该放弃编程,成为一名管道清洁工。继续努力。请记住,您不会在一个在线教程中找到解决方案

我建议您按照和博客中的安装说明进行安装。另请看一下。

在web服务器配置中更改文档根目录。例如:
document\u root/var/www


将此更改为
document\u root/var/www/cake
文档的根目录应指向您的项目。

在app/config/core.php中编辑core.php文件

在代码中找到这一行 定义(‘绝对URL’、完整基本URL’); 并将其更改为
define('ABSOLUTE_URL',FULL_BASE_URL.“subdirectory_name”)

例如:
define('ABSOLUTE_URL',FULL_BASE_URL./cake”)

是否尝试从
DocumentRoot
设置中删除
app/webroot
?或者这些文件夹真的存在吗?我确实尝试过将其从DocumentRoot设置中删除。奇怪的是,错误依然存在。是的,这些文件确实存在。我在另一个浏览器上试过,因为我认为可能是cookies的问题。我还重新启动了apache。但是,尽管从documentroot中删除了app/webroot,仍然会出现相同的错误。您的说明是在/Library/WebServer/Documents中按下按钮,所以我会在/Library/WebServer/Documents类型中按下按钮:ln-s/Users/username/Sites/cake-cake,然后我会编辑您的httpd.conf文件。就在这里/etc/httpd/httpd.conf不幸的是,那里没有这样的文件。该文件位于/private/etc/apache2/httpd.conf中,因此我在那里做了以下更改:DocumentRoot“/Library/WebServer/Documents/cake/app/webroot”AllowOverride All已设置为所有sudo apachectl restart现在我无法将pageI更改的DocumentRoot连接回/Users/jmerlino/Sites,现在它似乎正在工作。我读过的教程和你上面提供的教程都没有提到要这样做。然而,正是您发送的带有第三个问题的stackoverflow链接最终提醒我查看/Users/jmerlino/Sites。我给您一个接受的答案。但是你发布的面包店链接和博客已经过时了。是您提供的stackoverflow链接提供了解决方案。实际上是最底层的评论给出了解决方案,而不是给出解决方案的人。