Thinkphp5的安装

很长没有码代码了,现在开始做这件事情的意义已经完全与以前不一样了。因为最近有相当长的一段休息时间,是个学习的好时间啊。之前接触过TP3.2,听说后来的版本有挺大的改动,因此呢,现在终于有时间可以好好的体验一下。

为了方便操作,我就选择了composer安装:

1。安装composer

sudo apt install composer

 2。composer安装TP5框架

切换到网站根目录,输入命令:

composer create-project topthink/think tp5 --prefer-dist

 

3。测试thinkphp是否安装成功

 

补充:环境LNMP,配置服务器设置如下:

server {
        listen 80;
        listen [::]:80;
        root /web/tp5/public;
        # Add index.php to the list if you are using PHP
        index index.html index.htm index.php;
        server_name www.tp5.com;
        location / {
                if (!-e $request_filename) {
                        rewrite ^/index.php(.*)$ /index.php?s=$1 last;
                        rewrite ^(.*)$ /index.php?s=$1 last;
                        break;
                }
        }
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}
    

 

posted @ 2017-12-19 09:26  cicarius  阅读(971)  评论(0编辑  收藏  举报