CentOS下配置PHP+phpMyAdmin[服务器安全]
本文“CentOS下配置PHP+phpMyAdmin[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
花了点时间在自己的VPS上配置了PHP环境,并配置了phpmyadmin来管理mysql数据库.
之前的写了几篇linux下apache,jdk,tomcat,svn,vsftpd,yum的配置.apache已经与tomcat,svn整合好.
要用phpmyadmin来管理mysql数据库,那就必须配置php环境,我还是用yum来安装php.
我的CentOS yum里的php版本的有两个,一个是5.2的,另一个5.3,我安装了5.3的版本.
[root@ www.110hack.com certs]# yum install php53
[root@ www.110hack.com certs]# yum install php53-gd
[root@ www.110hack.com certs]# yum install php53-mysql
在安装php53-mysql(用于php衔接mysql数据库) 的时刻呈现问题了:
我MySQL安装是从mysql网站上下载的两个rpm包安装的:
MySQL-server-community-5.1.61-1.rhel5.i386.rpm
MySQL-client-community-5.1.61-1.rhel5.i386.rpm
当用yum安装php53-mysql时老是报以下错误:
[root@ www.110hack.com certs]# yum install php53-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.facebook.net
* extras: mirrors.ecvps.com
* updates: mirror.web-ster.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53-mysql.i386 0:5.3.3-7.el5_8 set to be updated
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15) for package: php53-mysql
--> Processing Dependency: libmysqlclient.so.15 for package: php53-mysql
--> Running transaction check
---> Package mysql.i386 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Conflict: mysql conflicts MySQL
--> Finished Dependency Resolution
mysql-5.0.95-1.el5_7.1.i386 from updates has depsolving problems
--> mysql conflicts with MySQL-server-community
Error: mysql conflicts with MySQL-server-community
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
Error: mysql conflicts with MySQL-server-community mysql与MySQL-server-community发生冲突.
我也试过用上面提醒的 --skip-broken 参数来跳过,但还是无效.
后来在一个英文网站上找到办理筹划:
首选要下载MySQL的一个rpm包:MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
然后按照下面的办法安装:
[root@ www.110hack.com certs]# rpm -ivh /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-shared-compat ########################################### [100%]
[root@ www.110hack.com certs]# rpm2cpio /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
| cpio -t | grep libmysqlclient
14550 blocks
./usr/lib/libmysqlclient.so
./usr/lib/libmysqlclient.so.10
./usr/lib/libmysqlclient.so.10.0.0
./usr/lib/libmysqlclient.so.12
./usr/lib/libmysqlclient.so.12.0.0
./usr/lib/libmysqlclient.so.14
./usr/lib/libmysqlclient.so.14.0.0
./usr/lib/libmysqlclient.so.15
./usr/lib/libmysqlclient.so.15.0.0
./usr/lib/libmysqlclient_r.so
./usr/lib/libmysqlclient_r.so.10
./usr/lib/libmysqlclient_r.so.10.0.0
./usr/lib/libmysqlclient_r.so.12
./usr/lib/libmysqlclient_r.so.12.0.0
./usr/lib/libmysqlclient_r.so.14
./usr/lib/libmysqlclient_r.so.14.0.0
./usr/lib/libmysqlclient_r.so.15
./usr/lib/libmysqlclient_r.so.15.0.0
[root@ www.110hack.com certs]# rpm2cpio /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
| cpio -ivd ./usr/lib/libmysqlclient_r.so.15
./usr/lib/libmysqlclient_r.so.15
14550 blocks
[root@ www.110hack.com certs]# rpm2cpio /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
| cpio -ivd ./usr/lib/libmysqlclient_r.so.15.0.0
./usr/lib/libmysqlclient_r.so.15.0.0
14550 blocks
[root@ www.110hack.com certs]# rpm2cpio /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
| cpio -ivd ./usr/lib/libmysqlclientr.so.15.0.0
14550 blocks
[root@ www.110hack.com certs]# rpm2cpio /home/resource/MySQL-shared-compat-5.1.63-1.rhel5.i386.rpm
| cpio -ivd ./usr/lib/libmysqlclientr.so.15
14550 blocks
[root@ www.110hack.com certs]# 履行完这些后,再用yum安装php53-mysql
[root@ www.110hack.com certs]# yum install php53-mysql
这回就可以安装成功.
测试下php能否安装成功:将下面的代码保存成info.php放入网站根目录
输入http://localhost/info.php 显示以下:
下面从网上下载phpmyadmin phpMyAdmin-3.5.1-all-languages.tar.gz
把这个压缩文件上传到VPS上,解压,并放到网站的根目录下:
//解压程序压缩包
tar xvfz phpMyAdmin-3.5.1-all-languages.tar.gz
//移动目录phpMyAdmin-3.5.1-all-languages到/home/www/ROOT/phpmyadmin文件夹
mv phpMyAdmin-3.5.1-all-languages /home/www/ROOT/phpmyadmin
//进入phpmyadmin目录
cd /home/www/ROOT/phpmyadmin
//复制样本配置文件到config.inc.php文件
cp config.sample.inc.php config.inc.php
//重启apache
service httpd restart
重启完httpd服务后,输入网址:http://localhost/phpmyadmin 显示以下:
以上是“CentOS下配置PHP+phpMyAdmin[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |