五分钟搞定Ubuntu 20.04安装Thinkphp 6

简介

Think PHP要求 PHP >= 7.1.0,必须通过Composer方式安装和更新

安装过程

安装PHP

这一步已经安装过合适版本的PHP可以跳过

 sudo apt-get install php7.4 -y
 sudo apt-get install libapache2-mod-php7.4 -y
 sudo apt-get install php7.4-mysql -y

可通过这个命令查找当前php7的最新稳定版本 apt-cache search php7
安装LAMP环境请参考这个

安装Think PHP

cd /var/www #这一步是进入项目安装位置,可自行调整
sudo apt install composer -y
composer -vvv create-project topthink/think tp
cd tp
php think run	#在默认端口8000启动tp,http://localhost:8000/
php think run -p 80  #指定在80端口启动tp

有安全组策略的服务器记得放行8000端口,不然浏览器就是404而不是下面的样子了
五分钟搞定Ubuntu 20.04安装Thinkphp 6_第1张图片

References

  • Centos TP6 https://blog.csdn.net/weixin_43031092/article/details/106708558
  • Ubuntu TP5 https://blog.csdn.net/roukmanx/article/details/85646174
  • LAMP https://blog.csdn.net/weixin_43031092/article/details/107348007

你可能感兴趣的:(Ubuntu)