方法一、通過官方網站直接下載:
(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的界面即安裝成功。
以上方法根據官方文檔練習操作。