rpm -ql php,rpm包安装LAMP

rpm包安装LAMP

实验环境:Redhat  Enterprise  Linux  5.4

需要安装的包:

Apache:

httpd-manual-2.2.3-31.el5

httpd-devel-2.2.3-31.el5

system-config-httpd-1.3.3.3-1.el5

httpd-2.2.3-31.el5

Mysql:

Mysql.i386

mysql-server.i386

Php:

php.i386

php-mysql.i386 php与mysql的连接器件

PhpMyadmin:

phpMyAdmin-2.11.10.1-all-languages.zip

php-mcrypt-5.1.6-5.el5.i386.rpm

libmcrypt-2.5.7-5.el5.i386.rpm   php-mcrypt依赖的模块

php-mbstring表示支持一些通用的字符集

php-gd.i386支持一些在线绘图功能

php-pear包含大量模块

php-xml.i386用于数据的交换

Phpwind:

phpwind_GBK_8.3.zip

步骤:

安装apache:

[root@server ~]# yum install –y httpd

[root@server ~]# rpm -qa |grep http*

httpd-manual-2.2.3-31.el5

httpd-devel-2.2.3-31.el5

system-config-httpd-1.3.3.3-1.el5

httpd-2.2.3-31.el5

安装mysql:

[root@server ~]# yum list mysql*

[root@server ~]# yum install -y mysql mysql-server

[root@server ~]# chkconfig --list |grep mysql

mysqld          0:关闭1:关闭2:关闭3:关闭4:关闭5:关闭6:关闭

[root@server ~]# chkconfig mysqld on设置自动启动

[root@server ~]# service mysqld start

[root@server ~]# netstat -tupln |grep mysql查看监听端口

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      7039/mysqld

mysql的操作:

[root@server html]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show datebase;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'datebase' at line 1

mysql> use test;

Database changed

mysql> show tables;

Empty set (0.00 sec)

mysql> \q

Bye

[root@server html]# mysqladmin -u root -p password '123456'为管理员设置口令

[root@server html]# mysql -u root –p以管理员身份访问mysql

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

安装php:

[root@server ~]# yum install -y php.i386

[root@server ~]# rpm -ql php

/etc/httpd/conf.d/php.conf

/usr/lib/httpd/modules/libphp5.so

/var/lib/php/session

/var/www/icons/php.gif

[root@server ~]# vim /etc/httpd/conf.d/php.conf

38bc97f8bda21c09bc4d4d5a02f6e402.png

[root@server ~]# cd /etc/httpd/modules/

[root@server modules]# ll |grep php

-rwxr-xr-x 1 root root 3014140 2009-02-26 libphp5.so

测试php的功能:做一个小的网页php可以嵌入到html里

[root@server modules]# cd /var/www/html

[root@server html]# mv index.html index.php

[root@server html]# vim index.php

d2975acc4441316126ff10ead5188c25.png

[root@server html]# service httpd restart

4345ae1093ab93c0a6698ab786196a5e.png

php中导入mysql:

[root@server ~]# yum list all php*

php-mysql.i386 php与mysql的连接器件 需安装

[root@server ~]# yum install -y php-mysql.i386

测试php与mysql连接是否成功:

[root@server ~]# cd /var/www/html

[root@server html]# vim index.php

c585d6ec192471fdff11ca2e7ebfb089.png

[root@server html]# service httpd restart重启服务

b63f032c172d148e6c215a5dc5dd9fbd.png

[root@server html]# service mysqld stop将连接失败

f8b0ce4ac2f91a72b74ccfd88306fdd8.png

安装phpmyadmin通过网页的形式管理数据库

下载phpmyadmin.zip压缩包放到管理员家目录

c942b352eabbba23e0c795014cf8ec32.png

[root@server ~]# unzip phpMyAdmin-2.11.10.1-all-languages.zip解压缩源文件

8a06764b4ad105a29aacc8e0afdbb8c2.png

做成虚拟目录:

[root@server ~]# mv phpMyAdmin-2.11.10.1-all-languages /var/www/html/phpmyadmin

308d8646f40dbcb41f8ae7687704c4e3.png

http://192.168.101.200/phpmyadmin设置口令访问拒绝

9ba113ec6b59e1627c507708da9d1724.png

通过# mysqladmin -u root -p password ""删除用户登录密码

访问成功 可以通过网页管理数据库~但是没有密码,访问不安全 此时可以:

[root@server html]# cd /var/www/html/phpmyadmin

0f2224c3ab796deef30f1fab82f722df.png

[root@server phpmyadmin]# cp config.sample.inc.php config.inc.php

[root@server phpmyadmin]# vim config.inc.php

fa82f2a21037b9c4840b0c6141d97eb7.png

[root@server phpmyadmin]# service httpd restart

测试:

72f6a8f305dedc591304b8ef49dd8f5a.png

05491636ba4841016635cc6abdbb4dc1.png

根据提示还需要安装以下包:

4f02d9cfbdcdedc85358afecdf9fb54f.png

[root@server ~]# yum localinstall php-mcrypt-5.1.6-5.el5.i386.rpm  libmcrypt-2.5.7-5.el5.i386.rpm --nogpgcheck

libmcrypt-2.5.7-5.el5.i386.rpm依赖的模块 -

--nogpgcheck取消gpg签名验证

[root@server ~]# yum list all |grep php

php-mbstring表示支持一些通用的字符集

php-gd.i386支持一些在线绘图功能

php-pear包含大量模块

php-xml.i386用于数据的交换

[root@server ~]# yum install -y php-mbstring.i386 php-gd.i386 php-pear.noarch php-xml.i386

f2b9011c757b2f0494bc9e062365a11d.png

测试:

f3813177fb626d5c576514d167eabcb0.png

89ea6774728ab16d522ad5a020b41657.png

此时可以很完美的通过网页管理数据库!

搭建好lamp环境后,此时可以做基于php的动态网站的应用,比如论坛phpwind:

下载phpwind_GBK_8.3.zip放到管理员家目录

[root@server ~]# unzip phpwind_GBK_8.3.zip解压缩

做成物理目录的概念

[root@server ~]# cd phpwind_GBK_8.3

[root@server phpwind_GBK_8.3]# ll

总计8

drwxr-xr-x  4 root root 4096 2010-12-21 docs

drwxr-xr-x 22 root root 4096 2010-12-21 upload

[root@server phpwind_GBK_8.3]# mv upload/ /var/www/html/phpwind

656e28fb894b4a5bcbec77ce1d4918c8.png

[root@server html]# vim /etc/httpd/conf/httpd.conf

fc965df3e01123b3b8ad14419f4f25d9.png

访问http://192.168.101.200/phpwind

97bef783647535f170fe64188b45f6f7.png

根据安装须知上的安装步骤:

第一步:

使用ftp工具,用二进制模式将该软件包里的upload目录下的所有文件上传到您的空间,假设上传后目录为upload

第二步:

c8ee2cd1ee16ea31483ac677d37288a2.png

[root@server html]# cd /var/www/html/phpwind

[root@server phpwind]# chmod -R 777 p_w_upload

[root@server phpwind]# chmod -R 777 data

[root@server phpwind]# chmod -R 777 html

……

……

第三步:填写安装信息

bc2c5aab0d873e19a17ebba3b4539cbd.png

254497ee697d35a9aba751f73e4e460b.png

99f776c27eb114fc1cea50389cf99ddf.png

624b3c94fb676f5902b034aa3cc54ed1.png

[root@server phpwind]# rm install.php删除掉install.php

rm:是否删除 一般文件 “install.php”? y

应用 http://192.168.101.200/phpwind:

前台页面 http://192.168.101.200/phpwind/index.php

f61a84c0ab3bee956648779b0c1a6161.png

后台页面 http://192.168.101.200/phpwind/admin.php

3c45a2a5310ffaa5eb8d922545a9391d.png

7530a17fc3dd152ff1db05a66c7d7aac.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值