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
/Root/desktop/json-1.2.1
# 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
#./Configure
# 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: // 127.0.0.1/index. 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 --------------------------------------