Home > php教程 > php手册 > ubuntu 11.10下面安装apache+php+mysql+phpadmin搭建web环境

ubuntu 11.10下面安装apache+php+mysql+phpadmin搭建web环境

WBOY
Release: 2016-06-06 19:58:23
Original
1196 people have browsed it

1.下载ubuntu11.10和vmware。 vmware下载安装请看:http://www.myxzy.com/read.php/90.htm 虚拟机安装ubuntu,这里就不说了。安装好ubuntu并启动。 2.设置本地网络连接,ip地址等。演示用nat桥接的方式上网,IP:192.168.128.3。 3.安装apache。打开终端,可

1.下载ubuntu11.10和vmware。
vmware下载安装请看:http://www.myxzy.com/read.php/90.htm
虚拟机安装ubuntu,这里就不说了。安装好ubuntu并启动。

2.设置本地网络连接,ip地址等。演示用nat桥接的方式上网,IP:192.168.128.3。

3.安装apache。打开终端,可以切换到root模式(下面就不说了,直接写命令)
sudo -s                      这是切换到root模式,这里提示要密码,输入密码即可。
sudo apt-get install apache2
这里会自动安装apache,不要关闭终端。等待安装完成。
用firefox打开http://localhost/,提示有“it works”,就是正常工作了。

4.安装php。
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
测试:sudo gedit /var/www/test.php
写入,然后保存,并用firefox打开 http://localhost/test.php,会显示PHP配置信息就是正确安装了php

5.安装mysql数据库
sudo apt-get install mysql-server
等到弹出密码输入,输入密码

给外部连接mysql的权限http://www.myxzy.com/read.php/279.htm


6.安装MYSQL for Apache HTTP Server
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
要让PHP与MySql一起工作,编辑
sudo gedit /etc/php5/apache2/php.ini
取消对;extension=mysql.so的注释,然后保存文件,最后重启apache
sudo /etc/init.d/apache2 restart

到了这里php+mysql+apache基本安装已经完成。


7.安装phpmyadmin

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

 

cd /etc/apache2/sites-available/

mkdir phpmyadmin

cp /etc/phpmyadmin/apache.conf /etc/apache2/sites-available/phpmyadmin

cd /etc/apache2/sites-enabled/  

sudo ln -s ../sites-available/phpmyadmin

sudo /etc/init.d/apache2 restart

打开localhost/phpmyadmin




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template