如何在localhost上安装cakephp? [英] How to install cakephp on localhost?

查看:130
本文介绍了如何在localhost上安装cakephp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在localhost上安装cakephp?
请解释一下。

I wanna to know how to install cakephp on localhost? Please explain me.

推荐答案

我通常在linuxbox上安装apache和mysql。我可以使用windows,但是我不推荐它)
所以,我通常在/ etc / hosts文件中创建一个新的条目,以使cakephp可用的网站名称。

I usually make an apache and mysql installation on a linuxbox. I can use windows too, however I do not recommend it ;) So, I usually make a new entry into the /etc/hosts file to make a sitename available to cakephp.

127.0.0.1   localhost caketest.local

下一步将所有cakephp文件复制到/ home / myusername / public_html / caketest下的子目录

next step to copy all cakephp files into a subdirectory inside /home/myusername/public_html/caketest

    app
    cake
    index.php
    plugins
    README
    vendors
    .htaccess

然后我将网站设置为apache(不是必需的),

then I set up the site to apache (not neccessary),

<VirtualHost *:80>
    DocumentRoot "/home/myusername/public_html/caketest"
    ServerName caketest.local  
    # This should be omitted in the production environment
    SetEnv APPLICATION_ENV development

    <Directory "/home/myusername/public_html/caketest">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

重新启动apache。您还需要编辑.htaccess文件,并将一个带有hte路径的RewriteBase指令放置到实际目录,例如

restart apache. you also need to edit the .htaccess files and place a RewriteBase directive with hte path to the actual directory, e.g.

RewriteBase /~myusername/caketest

创建数据库,在Cake配置文件中设置db连接。
,您可以将浏览器指向 http://caketest.local
,如果您不想使用测试网站网址跳过主机和apache vhost创建,但要使用的URL应该是http:/ localhost /〜myusername / caketest

create a database, set the db connection in cake config files and that's all. you can point your browser to http://caketest.local if you do not want a test site url you can skip hosts, and apache vhost creation, but the url to use should be http:/localhost/~myusername/caketest

另一个重要的事情是启用userdir modul在apache,并且还检查在userdirs中是否启用了php。

another important thing is to enable userdir modul in apache, and also check if using php is enabled in userdirs too.

这篇关于如何在localhost上安装cakephp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆