ubuntu 8.04 Lamp
一、
1、安装Apache服务
sudo apt-get install apache2
然后按照提示即完成apahce的安装了。这里 可以打开http://127.0.0.1,即可看于是It works
2、安装php5
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
OK之后,我们来查看一下是否生效了。
gksudo gedit /var/www/testphp.php
入探针
保存运行
http://127.0.0.1/testphp.php
3、安装mysql
sudo apt-get install mysql-server
安装完成按提示设置root密
4、让apache、php支持mysql
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysqlsudo /etc/init.d/apache2 restart
至此apache2+php 5.2.4.2+mysql5.0.51的环境就完成了。
二、
1.安装LAMP组件
系统–>系统管理–>新立得软件包管理器–>编辑 –> 使用任务分组标记软件包 –> 勾选 LAMP Server
在安装过程会提示输入MySQL的root密码。
2.让Apache支持.php
sudo gedit /etc/apache2/httpd.conf
输入:
AddType application/x-httpd-php .php
3.重启apache
sudo /etc/init.d/apache2 restart
这里可能出现:
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
解决方法是在httpd里面设置ServerName 为 127.0.0.1 。
sudo geidt /etc/apache2/httpd.conf
ServerName 127.0.0.1
4.在/var/www下新建index.php,内容:
路过。。。。。。
这个博客智能化程度很高,佩服。。。。。。