1、composer安裝
composer create-project topthink/think=5.1.x-dev tp5
2、配置nginx
server {
listen 80;
server_name mytp5.com;
root /mnt/g/thinkphp/tp5/public;
#add_header X-Frame-Options "SAMEORIGIN";
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
安裝成功
常用命令
Options:
-h, --help Display this help message
-V, --version Display this console version
-q, --quiet Do not output any message
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
clear Clear runtime file
help Displays help for a command
list Lists commands
run PHP Built-in Server for ThinkPHP
version show thinkphp framework version
make
make:command Create a new command class
make:controller Create a new resource controller class
make:event Create a new event class
make:listener Create a new listener class
make:middleware Create a new middleware class
make:model Create a new model class
make:service Create a new Service class
make:subscribe Create a new subscribe class
make:validate Create a validate class
optimize
optimize:route Build app route cache.
optimize:schema Build database schema cache.
route
route:list show route list.
service
service:discover Discover Services for ThinkPHP
vendor
vendor:publish Publish any publishable assets from vendor packages