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

「已注销」 2012-03-19 06:15:06
原centos系统自带的php版本是 5.1.6,使用yum安装了下php,但观察Configure Command 这行显示的是:

'./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,谢谢各位!

...全文
389 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
黄袍披身 2012-03-20
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 sea267 的回复:]

引用 1 楼 phpnewnew 的回复:
可能是yum里没有包含json mysql吧

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

然后
#phpize
#./configure (详细部分查看 README 啥的)
#make
#mak……
[/Quote]

可怜的孩子,我以前也一样,碰到问题了 赶紧装系统,呵呵,其实也好 装多两次提高经验,无奈Linux这东西的确是复杂了点。
「已注销」 2012-03-20
  • 打赏
  • 举报
回复

用的这个语句
rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

wget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webtatic.repo

yum --enablerepo=webtatic --exclude=php*5.3* list php

yum --enablerepo=webtatic --exclude=php*5.3* update -y php
「已注销」 2012-03-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 phpnewnew 的回复:]
可能是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

自己编译 编译好了 往……
[/Quote]感谢您的帮助... 昨天真是郁闷了,先手动编译安装的PHP,发现有许多错误,然后又用YUM 升级安装,还是不行。最后下了个lamp,结果apache都没能成功启动。。真是霉死了。。没辙,所以就重新安装了系统,然后用yum安装了下,就可以了!@
黄袍披身 2012-03-19
  • 打赏
  • 举报
回复
可能是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...

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧