Ubuntu LAMP環境PHP5.6

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
相關文章
相關標籤/搜索