方案1:集成解決方案
1.lnmp
https://lnmp.org/
2.xampp
https://www.apachefriends.org/zh_cn/index.html
3.oneinstack
https://oneinstack.com/
方案2:分別安裝各個組件
步驟一:安裝apache
ronyao@ubuntu:~$ sudo apt install apache2
http://localhost/
You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.
說明:
c) apache2根目錄,配置文件,以及修改訪問權限
默認根目錄:/var/www/html
配置文件: / etc/apache2/apache2.conf
# 在如下文件中把/var/www/ 改成 /home/cmm/ , 實現web目錄的重定向!
sudo gedit /etc/apache2/apache2.conf
# 重啟apache2服務器
service apache2 restart
步驟二:安裝PHP 7.0
sudo apt-get install software-properties-common
sudo add-apt-repositoryppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
php -v
如果出現以上信息,則證明安裝php7.0成功 整合一下php和apache
sudo apt install libapache2-mod-php7.2
步驟三:安裝MySQL
因為Ubuntu14.04下沒有Mysql5.7的源,需要連接外部資源庫進行下載
wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
sudo dpkg -i mysql-apt-config_0.6.0-1_all.deb
sudo apt-getupdate
sudo apt-getinstall mysql-server
# 在安裝過程中要輸入密碼
然后整合一下php和mysql
sudo apt-get install php7.2-mysql
步驟四:重啟MySQL和Apache
sudo service mysql restart
sudo service apache2 restart
OK,這樣就安裝好了
詳細參考:
https://www.cnblogs.com/duanyingkui/p/7327960.html
https://blog.csdn.net/lin308127947/article/details/79847732
http://blog.csdn.net/qq_33430445/article/details/71180272
php框架補充材料:
Lumen --Laravel的精簡版
Lumen就是Laravel的精簡版!拎包入住的就是Laravel,需要買鍋碗瓢盆,在拎包入住的就是Lumen。
一般來說開發API的服務端推薦使用Lumen,而開發web頁面使用Laravel。
不知如何選擇的時候,就用Laravel。
https://lumen.laravel-china.org/
https://lumen.laravel.com/
laravel - php框架
https://laravel.com/