首页 > 数据库 > Oracle > ubuntu下搭建php开发环境
一、使用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 php5-mysql phpmyadmin
安装结束后,检测是否成功:
(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文件,文件内容为:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21215624/viewspace-1114012/ ,如需转载,请注明出处,否则将追究法律责任。