Lamp构建论坛
 
实验环境:红帽Linux5.4企业版
通过php和mysql构建lamp环境构建论坛
安装php.i386
[root@localhost ~]# yum install -y php.i386
编辑网页
[root@localhost html]# vim index.php
Hello!!!!!!
<?php
phpinfo()
?>
重启服务
[root@localhost html]# service httpd restart
Stopping httpd:                                            [ OK ]
Starting httpd:                                            [ OK ]
检测

Lamp构建论坛_职场

 
安装数据库 存放帐号
安装mysql
 
[root@localhost html]# yum install -y mysql.i386
[root@localhost html]# yum install -y mysql-server.i386
查询
[root@localhost html]# chkconfig --list |grep mysql
mysqld             0:off 1:off 2:off 3:off 4:off 5:off 6:off
设置开机自动启动
[root@localhost html]# chkconfig mysqld on
[root@localhost html]# service mysqld start
查看运行端口
[root@localhost html]# netstat -tupln |grep mysql
安装php和mysql相关联软件
[root@localhost html]# yum install -y php-mysql
编辑测试网页
[root@localhost html]# vim index.php
Hello!!!
<?php
$link=mysql_connect('127.0.0.1','root','');
if ($link)
echo "ok";
else
echo "not ok"
?>
 

Lamp构建论坛_休闲_02

~  
为了方便管理数据库phpadmin的安装
把phpMyAdmin-2.11.10.1-all-languages.zip导入Linux系统的root目录下
unzip该zip包
[root@localhost ~]# unzip phpMyAdmin-2.11.10.1-all-languages.zip
移动文件建立一目录
[root@localhost ~]# mv phpMyAdmin-2.11.10.1-all-languages /var/www/html/phpmyadmin
访问http://192.168.2.100/phpmyadmin/

Lamp构建论坛_安装_03 

 

Lamp构建论坛_service_04

设置密码
[root@localhost html]# mysqladmin -u root -p password '123456'
[root@localhost html]# cd phpmyadmin/
[root@localhost phpmyadmin]# cp config.sample.inc.php config.inc.php
[root@localhost phpmyadmin]# vim config.inc.php
17 $cfg['blowfish_secret'] = 'redhat'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 添加密码
重启http服务
[root@localhost phpmyadmin]# service httpd restart
查看http://192.168.2.100/phpmyadmin/

Lamp构建论坛_休闲_05

安装mycrpt软件(php-mcrypt-5.1.6-5.el5.i386.rpm libmcrypt-2.5.7-5.el5.i386.rpm)
[root@localhost ~]# yum localinstall php-mcrypt-5.1.6-5.el5.i386.rpm libmcrypt-2.5.7-5.el5.i386.rpm –nogpgcheck

Lamp构建论坛_休闲_06

root登录
 

Lamp构建论坛_service_07

由于未发现php的扩展设置mbstring,需安装php-gd php-mbstring php-pea php-xml等软件包
[root@localhost ~]# yum install -y php-gd php-mbstring php-pear php-xml
 

Lamp构建论坛_安装_08

Lamp环境已成功搭建完成
论坛的实现
解压
[root@localhost ~]# unzip phpwind_GBK_8.3.zip
建立虚拟目录
[root@localhost ~]# cd phpwind_GBK_8.3
[root@localhost phpwind_GBK_8.3]# mv upload/ /var/www/html/phpwind
修改编码禁用UTF-8
[root@localhost phpwind_GBK_8.3]# vim /etc/httpd/conf/httpd.conf
747 #AddDefaultCharset UTF-8
重新启动apache服务
[root@localhost phpwind_GBK_8.3]# service httpd restart
查看http://192.168.2.100/phpwind/install.php

Lamp构建论坛_论坛_09

设递归设置目录权限为777简单如下
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# cd phpwind/
[root@localhost phpwind]# chmod -R 777 p_w_upload
[root@localhost phpwind]# chmod -R 777 data
[root@localhost phpwind]# chmod -R 777 html
选择 开始安装

Lamp构建论坛_安装_10

同意协议下一步

Lamp构建论坛_休闲_11

填写信息,下一步

Lamp构建论坛_休闲_12

安装详细信息

Lamp构建论坛_论坛_13

安装成功
 

Lamp构建论坛_安装_14

删除inistall.php文件
[root@localhost phpwind]# rm inistall.php

Lamp构建论坛_安装_15 

管理员登录:

Lamp构建论坛_论坛_16

Lamp构建论坛_休闲_17 

 

Lamp构建论坛_休闲_18 

登陆成功!!!