1.安装Apachephp
sudo apt-get update sudo apt-get install apache2
2.启动Apachemysql
service apache2 restart
启动的时候可能会出现以下警告:sql
apache2: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
说明你没有指定ServerName。若是想去掉这个错误,能够修改/etc/apache2/apache2.conf文件:apache
sudo vi /etc/apache2/apache2.conf
添加以下行:vim
ServerName localhostiview
3.开启伪静态dom
vim /etc/apache2/apache2.conf #添加以下代码 <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>
#重启Apache
service apache2 restart
4.安装PHP5.6curl
sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip php5.6-cgi libapache2-mod-php5.6
5.安装mysqlurl
sudo apt-get install mysql-server