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

相关文章
相关标签/搜索