天天看點

為Ubuntu搭建LAMP(Apache+PHP+MYSQL)開發環境

使用apt-get方式為Ubuntu安裝PHP+MYSQL+Apache

分别執行如下指令:

(1)安裝MYSQL

sudo apt-get install mysql-server

sudo apt-get install mysql-client

(2)安裝Apache

sudo apt-get install apache2

(3)安裝PHP

sudo apt-get install php5

sudo apt-get install libapache2-mod-auth-mysql

sudo apt-get install php5-mysql

安裝結束後,檢測是否成功:

(1)檢測Mysql是否正常

在終端中輸入:mysql -uusername-ppassword (将username和password替換為你所設定的)看是否可以正常登陸

(2)檢測Apache是否正常

在浏覽器中打開:http://localhost/

如果出現如下資訊,則表明正常。

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.