Thinkphp5学习 Windows下的安装

 

 

方法一、通过官方网站直接下载:

(1)下载地址:http://www.thinkphp.cn/down.html;

(2)下载后,解压到web目录下;

(3)访问:http://localhost/目录名字/public/ 

(4)看到ThinkPHP V5的界面即安装成功。

 

方法二:

通过composer命令安装,

(1)使用管理员身份执行命令行;

(2)切换到web目录下,执行命令:composer create-project thinktop/tp=5.0.*  tp5 --prefer-dist

(3)看到web目录里多了个tp5的目录,访问http://localhost/tp5/public/; 

(4)看到ThinkPHP V5的界面即安装成功。

注意:命令中的tp5是目录名字,可以修改。

 

方法三、使用git安装:

(1)再web目录下,新建一个项目目录tp5,进入目录,右键选择git bash here,弹出git的命令行窗口;

(2)执行命令,克隆下载应用项目仓库:git clone https://github.com/top-think/think ./

如果这个时候访问地址http://localhost/tp5/public/ 会报一下错误:

Warning: require(C:\wamp64\www\frame\Tp_5\tp5_git_coding\public/../thinkphp/base.php): failed to open stream: No such file or directory in C:\wamp64\www\frame\Tp_5\tp5_git_coding\public\index.php on line 16

Fatal error: require(): Failed opening required 'C:\wamp64\www\frame\Tp_5\tp5_git_coding\public/../thinkphp/base.php' (include_path='.;C:\php\pear') in C:\wamp64\www\frame\Tp_5\tp5_git_coding\public\index.php on line 16

(3)克隆核心框架仓库:git clone https://github.com/top-think/framework thinkphp

(4)访问http://localhost/tp5/public/ ,看到ThinkPHP V5的界面即安装成功。

 

以上方法根据官方文档练习操作。

 

posted @ 2018-05-31 10:35  学知无涯  阅读(3925)  评论(0编辑  收藏  举报