1.換源
備份原先的源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list
換成
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
更新
apt-get update
2.安裝apache2
apt-get install apache2
service apache2 restart
在本地瀏覽器打開(kāi)localhost 應(yīng)該可以看到apache2的歡迎界面
3.安裝php
按照ubuntu安裝的方法 apt-get install php5是沒(méi)法用的怠肋,不曉得為啥子
我找的解決辦法是如下:
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php
apt-get install libapache2-mod-php
service apache2 restart
4.測(cè)試php
在/var/www/html目錄下新建test.php
內(nèi)容如下:
<?php
phpinfo();
?>
打開(kāi)localhost/test.php 正常顯示則代表成功
5.至于mysql 的安裝馒稍,后續(xù)再寫(xiě)