centos 下使用 yum 安装php 5.2.17 无法使用mysql_connect、json_encode等函数解决方法

php中文网
发布: 2016-06-13 13:34:09
原创
1351人浏览过

centos 下使用 yum 安装php 5.2.17 无法使用mysql_connect、json_encode等函数
原centos系统自带的php版本是 5.1.6,使用yum安装了下php,但观察Configure Command 这行显示的是:

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' 
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' 
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' 
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' 
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' 
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' 
'--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' 
'--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' 
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' 
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' 
'--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' 
'--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' 
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' 
'--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' 
'--enable-shmop' '--enable-calendar' '--without-mime-magic' 
'--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' 
'--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '<SPAN style="COLOR: #e53333">--without-mysql</SPAN>' 
'--without-gd' '--disable-dom' '--disable-dba' 
'--without-unixODBC' '--disable-pdo' '--disable-xmlreader' 
'--disable-xmlwriter' '<SPAN style="COLOR: #e53333">--disable-json</SPAN>' '--without-pspell' 
'--disable-wddx' '--without-curl' '--disable-posix' 
'--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' 

登录后复制

--without-mysql

--disable-json
如上,mysql和json全被禁用了,请问该如何修改这个选项能正常使用json、mysql,谢谢各位!



------解决方案--------------------
可能是yum里没有包含json mysql吧

都自己下源码包
例如json
http://www.aurore.net/projects/php-json/php-json-ext-1.2.1.tar.bz2
然后解压

然后
#phpize
#./configure (详细部分查看 README 啥的)
#make
#make install

自己编译 编译好了 往php.ini添加
extension=xxx.so

重启apache...
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号