PHP 5.3.8、JSON 和中央操作系统 6

2024-04-13php开发问题
1

本文介绍了PHP 5.3.8、JSON 和中央操作系统 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我们正在运行 CentOS 6 和 PHP 5.3.8(作为 apache 模块),它们应该将 JSON 作为其核心的一部分(有人告诉我).查看命令行上的 # php -i 我可以在配置命令下看到 '--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_DELREF0

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 和中央操作系统 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17