Think PHP框架搭建

1.Think PHP框架搭建

(1)WampServer下载以及安装

 

下载完成后直接安装,安装中一直下一步就行。但是你要注意你安装的目录。

 

 

(2)WampServer的配置

启动WampServer,修改httpd.conf中的配置,httpd.conf的路径如下图所示。

 

若出现You don't havepermission to access / on this server.
 

需要修改一下php的配置文件httpd.conf

在原有的位置文件中找到配置节,修改成

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all
 
 
#允许所有访问
    Satisfy all
</Directory>


还有

<Directory"D:/Wamp/www">
    #
    # Possible values for the Options directiveare "None", "All",
    # or any combination of:
    #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must benamed *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicatedand important.  Please see
    #http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directivesmay be placed in .htaccess files.
    # It can be "All","None", or any combination of the keywords:
    #  Options FileInfo AuthConfig Limit
    #
    AllowOverride all
    #
    # Controls who can get stuff from thisserver.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>


 

修改成

 

<Directory"D:/Wamp/www">
    #
    # Possible values for the Options directiveare "None", "All",
    # or any combination of:
    #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must benamed *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicatedand important.  Please see
    #http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directivesmay be placed in .htaccess files.
    # It can be "All","None", or any combination of the keywords:
    #  Options FileInfo AuthConfig Limit
    #
    AllowOverride all
    #
    # Controls who can get stuff from thisserver.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
#    Deny from all
# Allow from 127.0.0.1
    Allow from all
</Directory>

 

然后保存,重启服务,在访问就解决了这个问题。

 

phpmyadmin的配置如下(路径为wamp/alias/phamyadmin.conf

 

 

3)搭建ThinkPHP框架

一、下载ThinkPHP

网址:http://www.thinkphp.cn/下载你需要的版本(下载完整版,不要下载核心版)

 

二、搭建ThinkPHP

www文件夹中新建一个文件夹(我建的是think),将下载的ThinkPHP中的ThinkPHP拷贝到think文件夹里面。

 

 

新建一个.phpindex.php,代码如下所示(其中Index文件是运行后生成的)可能有的ThinkPHP版本还需要在第三行下面定义define('RUNTIME_PATH',APP_PATH.'Temp/');//定义编译目录位置。

 

三、搭建文成结果展示

在浏览器中输入127.0.0.1/think/index.php出现如下内容,同时生成Index文件夹。

 控制器文件找到IndexAction.class.php(目录如下图所示),运行输出HelloWorld说明安装成功。


 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值