Unable to load dynamic library '/usr/lib64/php/modules/json.so'

[root@slave modules]# php -m
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

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




[root@slave php-json-ext-1.2.1]# vi JSON_parser.c 
/* JSON_parser.c */


/* 2005-12-30 */


/*
Copyright (c) 2005 JSON.org
………………

#include "JSON_parser.h"
#include <stdio.h>


#define true  1
#define false 0


/*
    Characters are mapped into these 32 symbol classes. This allows for    significant reductions in the size of the state transition table.
*/


/* error */#define S_ERR -1
#define ZVAL_DELREF Z_DELREF_P      加入这一行
/* space */
#define S_SPA 0


/* other whitespace */
#define S_WSP 1


/* {  */
#define S_LBE 2
"JSON_parser.c" 757L, 21504C written
[root@slave php-json-ext-1.2.1]# phpize 
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

[root@slave php-json-ext-1.2.1]# ./configure 
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
………………………………
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
[root@slave php-json-ext-1.2.1]# make 
/bin/sh /tmp/php-json-ext-1.2.1/libtool --mode=compile cc  -I. -I/tmp/php-json-ext-1.2.1 -DPHP_ATOM_INC -I/tmp/php-json-ext-1.2.1/include -I/tmp/php-json-ext-1.2.1/main -I/tmp/php-json-ext-1.2.1 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-json-ext-1.2.1/utf8_to_utf16.c -o utf8_to_utf16.lo 
libtool: compile:  cc -I. -I/tmp/php-json-ext-1.2.1 -DPHP_ATOM_INC -I/tmp/php-json-ext-1.2.1/include -I/tmp/php-json-ext-1.2.1/main -I/tmp/php-json-ext-1.2.1 -………………………………
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'


See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------


Build complete.
Don't forget to run 'make test'.


[root@slave php-json-ext-1.2.1]# make install 
Installing shared extensions:     /usr/lib64/php/modules/
[root@slave php-json-ext-1.2.1]# /etc/init.d/httpd restart
Stopping httpd:                                           [  OK  ]
Starting httpd:                                           [  OK  ]

echo "extensio=json.so" >> /etc/php.ini
[root@slave php-json-ext-1.2.1]# php -m
PHP Warning:  Module 'json' already loaded in Unknown on line 0
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
memcache
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xml
zip
zlib



/etc/init.d/httpd restart即可

根据错误提示,JNA无法在资源路径中找到'/usr/lib/libJerasure.so'本地库文件。这可能是由于以下原因之一导致的: 1. 确保'/usr/lib/libJerasure.so'文件存在且位于正确的位置。你可以使用命令行检查该文件是否存在: ```shell ls /usr/lib/libJerasure.so ``` 如果文件不存在,请确认你是否已正确安装该库,并将其放置在'/usr/lib/'目录下。 2. 检查资源路径是否正确设置。你可以使用`java.library.path`系统属性来指定资源路径。确保资源路径中包含'/usr/lib'目录。例如: ```java System.setProperty("java.library.path", "/usr/lib"); ``` 注意:这个属性应该在程序启动之前设置。 3. 确保应用程序有足够的权限访问'/usr/lib/libJerasure.so'文件。你可以检查文件的权限设置,并确保应用程序在运行时具有读取权限。 4. 如果你在使用IDE(如Eclipse、IntelliJ等),请确保将库文件添加到项目的构建路径中。将'/usr/lib/libJerasure.so'文件复制到项目中,并确保构建配置正确。 5. 如果上述方法仍然无法解决问题,可以尝试将'/usr/lib/libJerasure.so'文件复制到JVM库搜索路径中。这可以通过设置LD_LIBRARY_PATH环境变量来实现。例如: ```shell export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH ``` 这将将'/usr/lib'目录添加到库搜索路径中,使得JVM能够找到该库。 请根据你的具体情况尝试上述解决方法。如果问题仍然存在,请提供更多细节,以便我可以给出更具体的建议。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值