PHP 5.3.8, JSON &CentOS 6 [英] PHP 5.3.8, JSON & CentOS 6

查看:25
本文介绍了PHP 5.3.8, JSON &CentOS 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行 CentOS 6 和 PHP 5.3.8(作为 apache 模块),它们应该将 JSON 作为其核心的一部分(有人告诉我).在命令行上查看 # php -i 我可以在 Configure Command '--enable-json=shared' 下看到......太棒了!

We're running CentOS 6 and PHP 5.3.8 (as an apache module) which should have JSON as part of it's core (I'm told). Looking at # php -i on the command line I can see under Configure Command '--enable-json=shared' ... great!

但是,查看网页配置命令上的 php_info() 显示 '--disable-json'.

However, looking at php_info() on a web page Configure Command shows '--disable-json'.

我想没问题,我会使用 pecl 安装它:

No problem I thought, I'll just install it using pecl:

# yum update php
# yum install php-pear
# yum install gcc
# pecl install json
# service httpd restart

成功了,我认为应该这样做.但是 php -m 显示:

Success, that aught to do it I thought. However php -m shows:

PHP 警告:PHP 启动:无法加载动态库 '/usr/lib64/php/modules/json.so' -/usr/lib64/php/modules/json.so:未定义符号:ZVAL_DELREF in Unknown on line0

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/json.so' - /usr/lib64/php/modules/json.so: undefined symbol: ZVAL_DELREF in Unknown on line 0

抱歉,如果这是一个愚蠢的问题,但有没有人知道这里发生了什么,你能指出我如何解决这个问题的正确方向,以便 JSON 开始工作吗?

Apologies if this is a silly question but does anyone know what's going on here and could you point me in the right direction on how to fix this so that JSON starts working?

非常感谢

推荐答案

我想我会跟进解决方案.PECL 安装似乎与 PHP 5.3.8 冲突,所以经过一些研究和一些建议后,我想到了:

Thought I'd follow up with the solution. The PECL installation seemed to conflict with PHP 5.3.8 so after a bit of research and some advice I toyed with the idea of:

# yum remove php
# yum install php

然而,经过进一步的建议,改为:

However, after further advice instead went with:

# yumdownloader php-common
# rpm -Uvh --force php-common*.rpm
# service httpd reload
# rm php-common*.rpm

这成功了,JSON 现在又可以工作了.希望这对其他人有帮助.

This did the trick and JSON is now working again. Hope this helps someone else.

谢谢

这篇关于PHP 5.3.8, JSON &CentOS 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆