In CentOS 6.3, an error is reported when the JSON module is compiled and installed in PHP.

Source: Internet
Author: User

In CentOS 6.3, an error is reported when the JSON module is compiled and installed in PHP.

An error occurred while installing the JSON module when I set up the monitoring system. For CentOS 6.3 In PHP5.3, The ZVAL_DELREF symbol is unknown...
# Warning: PHP Startup: Unable to load dynamic library '/home/json/json-1.2.1/modules/json. so '-/home/json/json-1.2.1/modules/json. so: undefined symbol: ZVAL_DELREF in Unknown on line 0

The php version is used as the cause. The solution is as follows:

# Tar xf json-1.2.1.tgz
# Cd json-1.2.1
# Pwd
# Vim JSON_parser.c
# Define ZVAL_DELREF Z_DELREF_P // This symbol is not supported when PHP5.3 is installed in rpm. You need to manually add the symbol and install it during compilation. Do not remove the # symbol before it. Just add it to the front of the file.

# Phpize // If the phpize command is not available, use yum to install the php-devel package
# Make & make install
# Find/-name * json. so // check whether the json module exists
/Usr/lib64/php/modules/json. so
# Vim/etc/php. ini // Add the following lines
Extension = json. so
# Vim/etc/php. d/json. ini // create the json. ini file and add the following two lines
; Enable snmp extension module
Extension = json. so

Test whether php loads the json module:
1) run the php-m command to check whether the json module has been loaded by php.
# Php-m
Json // view the printed Module

2) use the php test page to view the verification

# Vim/var/www/html/index. php // create a php browser page and add the following content

<? Php
Phpinfo ();

When you log on to http: // php In the browser, the following content also proves that the installation and loading are successful.

-------------------------------------- Split line --------------------------------------

Send XML and JSON data asynchronously in Struts

Compiling and code testing of the JSON library in Linux

JQuery retrieves JSON data [$. getJSON method]

Convert form data into JSON strings using jQuery and JSON packages

Parse JSON configuration file in C Language

-------------------------------------- Split line --------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.