在ubuntu下安裝php的方法:
1.打開終端命令行。
2.依次輸入以下命令進行安裝即可。
sudo apt-get update #更新源sudo apt-get install php5.6 #安裝php5.6版本php -m #安裝成功
sudo apt-get update #更新源
sudo apt-get install php5.6 #安裝php5.6版本
php -m #安裝成功
3.安裝成功后,重啟一下apache服務。
# /etc/init.d/apache2 restart或systemctl restart apache2
# /etc/init.d/apache2 restart
或
systemctl restart apache2