- 安装Apache
sudo apt-get install apache2
- 安装php7
sudo apt-get install php7.0
- 让Apache能够识别解析PHP文件,搜索适合PHP7的插件:
apt-cache search libapache2-mod-php
- 安装插件
sudo apt-get install libapache2-mod-php7.0
- 安装MySQL(此处是Ubuntu16.04的安装方式,Ubuntu18.04安装方式自行查询)
sudo apt-get install mysql-server mysql-client
- 安装php的mysql插件
sudo apt-get install php7.0-mysql
- 安装phpmyadmin
sudo apt-get install phpmyadmin
- 建立符号链接将/usr/share中的phpmyadmin链接到/var/www/html中
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
重启apahce
sudo /etc/init.d/apache2 restart
- 安装php扩展(php7.0)
sudo apt-get install php-dev
- 到 https://github.com/swoole/swoole-src/releases查看最新版本(注意:2.0.12版本开始不支持php5)
cd /
sudo wget https://github.com/swoole/swoole-src/archive/v2.0.12.tar.gz
tar -xzvf v2.0.12.tar.gz
- 到swoole目录下,编译
cd swoole-src-2.0.12
sudo phpize
sudo ./configure
sudo make
make install //产生swoole安装的扩展地址/usr/lib/php/20151012
- 找到etc/php/7.0/cli/php.ini加入 extension=/usr/lib/php/20151012/swoole.so
- 重启apache2服务器
- 输入 php -m 查看是否有swoole扩展
- thinkphp 隐藏index.php路径:
https://blog.csdn.net/z18865511593/article/details/64444817
https://blog.csdn.net/weixin_39973810/article/details/78630354