爲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.

(3)檢測PHP是否正常

Ubuntu下Apache的默認安裝路徑爲/var/www/,到其目錄下新建info.php文件,文件內容爲:

phpinfo()

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章