ОБНОВЛЕНИЕ CakePHP - Запрошенный URL не был найден на этом сервере - PullRequest
4 голосов
/ 23 октября 2010

УСТАНОВКА КАФЕ ДЛЯ БОЛЬНЫХ

Если вы похожи на меня, вы разочарованы такими фреймворками, как 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. 

Если у вас больше есть проблемы, это не значит, что вы должны отказаться от программирования и стать трубочистом. Просто продолжай пытаться. Просто помните, что вы не найдете решения в одном онлайн-учебнике.

Ответы [ 3 ]

0 голосов
/ 07 июля 2015

Измените document_root в конфигурации вашего веб-сервера. например: document_root /var/www

Измените это на document_root /var/www/cake. document_root должен указывать на ваш проект.

0 голосов
/ 09 июля 2015

отредактируйте файл core.php в app / config / core.php

найдите эту строку в коде DEFINE ( ​​'ABSOLUTE_URL', FULL_BASE_URL "".); и измените это на define('ABSOLUTE_URL',FULL_BASE_URL."subdirectory_name"); например: define('ABSOLUTE_URL',FULL_BASE_URL."/cake");

0 голосов
/ 23 октября 2010

Я бы посоветовал вам следовать инструкциям по установке из пекарни и настройке из этого блога.Также взгляните на этот билет .

...