您的位置:首页 > 编程语言 > PHP开发

liunx php(自带5.3.3) 版本升级 mysql(自带版本5.1.73)版本升级

2016-08-12 16:32 507 查看
升级php5.6

yumlistinstalled|grepphp
如果有安装的PHP包,先删除他们

yumremovephp.x86_64php-cli.x86_64php-common.x86_64php-gd.x86_64php-ldap.x86_64php-mbstring.x86_64php-mcrypt.x86_64php-mysql.x86_64php-pdo.x86_64

2.Centos5.X
rpm-Uvhhttp://mirror.webtatic.com/yum/el5/latest.rpm
CentOs6.x
rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm
CentOs7.X
rpm-Uvhhttps://mirror.webtatic.com/yum/el7/epel-release.rpmrpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm如果想删除上面安装的包,重新安装

rpm-qa|grepwebstatic
rpm-e上面搜索到的包即可

3.运行yuminstall

yuminstallphp55w.x86_64php55w-cli.x86_64php55w-common.x86_64php55w-gd.x86_64php55w-ldap.x86_64php55w-mbstring.x86_64php55w-mcrypt.x86_64php55w-mysql.x86_64php55w-pdo.x86_64
注:如果想升级到5.6把上面的55w换成56w就可以了。

yuminstallphp56w.x86_64php56w-cli.x86_64php56w-common.x86_64php56w-gd.x86_64php56w-ldap.x86_64php56w-mbstring.x86_64php56w-mcrypt.x86_64php56w-mysql.x86_64php56w-pdo.x86_64
4.安装PHPFPM

yuminstallphp55w-fpm
注:如果想升级到5.6把上面的55w换成56w就可以了。

原文:'target='_blank'>http://ju.outofmemory.cn/entry/227622[/code]
升级mysql5.5http://www.laozuo.org/6145.html


CentOS7yum安装php5.6
配置yum源
追加CentOS6.5的epel及remi源。

#rpm-Uvhhttp://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm#rpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm以下是CentOS7.0的源。

#yuminstallepel-release
#rpm-ivhhttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm使用yumlist命令查看可安装的包(Packege)。

#yumlist--enablerepo=remi--enablerepo=remi-php56|grepphp
安装PHP5.6
yum源配置好了,下一步就安装PHP5.6。

#yuminstall--enablerepo=remi--enablerepo=remi-php56phpphp-opcachephp-develphp-mbstringphp-mcryptphp-mysqlndphp-phpunit-PHPUnitphp-pecl-xdebugphp-pecl-xhprof
用PHP命令查看版本。

#php--version


yum-yphp-mysql//安装mysql扩展(mysql.so)不安装的话就不能使用mysql_connect()来连接数据库

extension=mysql.so
/usr/lib64/php/modules/mysql.so//php扩展目录

后来我用了其他的方法,直接安装mysqldn,就替换这个了,可以直接用yum安装,比这个方便。
whereismysql//查看文件的安装目录
whichmysql//查询运行文件所在路径(文件夹地址)

usr/bin/mysql是指:mysql的运行路径
var/lib/mysql是指:mysql数据库文件的存放路径
usr/lib/mysql是指:mysql的安装路径

cd/usr/local/php5.3/bin/
phpize--with-mysql=/usr/lib64/mysql/

/usr/local/php5.3/bin/phpize--with-mysql=/usr/lib64/mysql/

whereismysql//查看php各种文件的目录地址
/etc/php.ini//php配置文件
/etc/php.d///添加php其它配置文件xx.ini的目录
/usr/lib64/php/modules///phpxx.so扩展安装目录
/usr/local/php5.3//php文件目录

/usr/lib64/php/modules//php扩展源的目录


rpm源码安装步骤
#cd/usr/src
#wgethttp://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz#tar-zvxfm4-1.4.9.tar.gz
#cdm4-1.4.9/
#./configure&&make&&makeinstall


php-m|grepgd



问题背景:平常我们都是先安装mysql,然后才能去安装php。假如先安装php,后安装mysql,由于php需要连接mysql,因而在php引擎中需要配置使用mysql.so扩展。这时需要手动编译生成mysql.so扩展。

当前问题:在上面情况下,使用phpize能否实现挂接mysql.so扩展?

实践结论:使用phpize工具能够生成mysql.so,但是必须加上"--with-mysql=mysql客户端的路径"。也就是mysql.so模块必须用到mysql客户端才行。
可以这样理解,mysql.so内部会调用mysql客户端,以便实现连接mysql数据库服务器。
我们常常用到的mysql_connect()可能就是调用了mysql客户端才能完成连接数据库的操作。

./configure--with-php-config=/usr/local/php5.3/bin/php-config--with-mysql=/usr/local/mysql

使用phpize工具能够生成mysql.so,但是必须加上"--with-mysql=mysql客户端的路径"//mysql的安装路径?
http://linuxzj.blog.51cto.com/6160158/163215051cto博客http://yangtong.blog.51cto.com/981099/577754http://88fly.blog.163.com/blog/static/12268039020116226420321/


root@VM_197_107_centos~]#yuminstallphp-fpm-y
已加载插件:fastestmirror,security
设置安装进程
Repositoryepelislistedmorethanonceintheconfiguration
Loadingmirrorspeedsfromcachedhostfile
*remi-safe:mirror.innosol.asia
*webtatic:uk.repo.webtatic.com
解决依赖关系
-->执行事务检查
--->Packagephp-fpm.x86_640:5.3.3-49.el6willbe安装
-->处理依赖关系php-common(x86-64)=5.3.3-49.el6,它被软件包php-fpm-5.3.3-49.el6.x86_64需要
-->执行事务检查
--->Packagephp-common.x86_640:5.3.3-49.el6willbe安装
-->处理php56w-common-5.6.30-1.w6.x86_64与php-common<5.6的冲突
-->完成依赖关系计算
错误:php56w-commonconflictswithphp-common-5.3.3-49.el6.x86_64
Youcouldtryusing--skip-brokentoworkaroundtheproblem
Youcouldtryrunning:rpm-Va--nofiles--nodigest

在安装过php5.3的环境中安装php-fpm要知道php-fpm的版本

yuminstallphp56w-fpm-y
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: