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

使用apt-get方式爲Ubuntu安裝PHP+MYSQL+Apachephp

分別執行以下命令:mysql

(1)安裝MYSQLweb

sudo apt-get install mysql-serversql

sudo apt-get install mysql-clientapache

(2)安裝Apache瀏覽器

sudo apt-get install apache2ide

(3)安裝PHPthis

sudo apt-get install php5server

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

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()

相關文章
相關標籤/搜索