1

I'm trying to loading JSON into the new-installed PHP5.3.1 on a CentOS server. Previously there was a PHP5.1 or near and due to the latest version of WordPress I had to upgrade the PHP.

I tried to install JSON via yum with:

    yum install php-pecl-json

But I get a "php53-common is in conflict with php-common". With --skip-broken doesn't work, either.

I've tried it manually and got the JSON package via PEAR:

 pear install pecl/json

After some errors regarding certain functions that are decrapted in this new version of PHP, I still got the following error on php -v:

 # php -v
 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 5.3.3 (cli) (built: Mar 30 2011 13:51:54) 

Afterwards, I've installed JSON manually, entered the folder and did phpize prior to ./configure, make and make install. I also copied the json.so to /usr/lib64/php/modules. Nothing working so far.

The json.ini in /etc/php.d states:

extension = json.so

I did replace json.so from "extension = " with /usr/lib64/php/modules/json.so. And also entered "/usr/lib64/php/modules" as extension_dir into /etc/php.ini.

No luck. Can anyone help?

Thank you.

UPDATE:

 # yum repolist
 Loaded plugins: fastestmirror
 Loading mirror speeds from cached hostfile
  * base: centos.mirror.lstn.net
  * epel: fedora-epel.mirror.lstn.net
  * extras: centos-distro.cavecreek.net
  * rpmforge: fr2.rpmfind.net
  * updates: mirrors.serveraxis.net
 base                                                     | 2.1 kB     00:00     
 epel                                                     | 3.7 kB     00:00     
 extras                                                   | 2.1 kB     00:00     
 rpmforge                                                 | 1.1 kB     00:00     
 updates                                                  | 1.9 kB     00:00     
 repo id      repo name                                           status
 base         CentOS-5 - Base                                     enabled:  3,535
 epel         Extra Packages for Enterprise Linux 5 - x86_64      enabled:  6,543
 extras       CentOS-5 - Extras                                   enabled:    299
 rpmforge     RHEL 5 - RPMforge.net - dag                         enabled: 10,691
 updates      CentOS-5 - Updates                                  enabled:    765
 repolist: 21,833

UPDATE 2: JSON is already packed within php-common, so when installing PHP from REMI repo, for example, version 5.3.6 you'll already have JSON installed.

It seems that after that, trying to install JSON via pecl install json or manually will output the error I've stated above.

Thank you.

1
  • "undefined symbol: ZVAL_DELREF" isan indication that the .so file was compiled in a wrong way. (ZVAL_DELREF is a C preprocessor macro an should not appear in the binary)
    – johannes
    Nov 27, 2011 at 19:45

1 Answer 1

0

But I get a "php53-common is in conflict with php-common". With --skip-broken doesn't work, either.

Please give us the output of yum repolist?

"No luck" means still got the same error when installing via pear?

Afterwards, I've installed JSON manually, entered the folder and did phpize prior to ./configure, make and make install. I also copied the json.so to /usr/lib64/php/modules

make install will copy the extension to /usr/lib64/php/modules automatically, no need to manual copy.

Also take a look at created time to make sure that you loaded the right extension. Don't forget to reload (restart) Apache after that.

4
  • Hello! Thank you for your help. I've updated my post with yum repolist. As to the created time, I'm not sure how to see that, but I did this: ls -l json.so: -rwxr-xr-x 1 root root 96637 Aug 3 02:03 json.so.
    – Max
    Aug 3, 2011 at 6:00
  • Can you talk more details: what's the root cause and how do you fix?
    – quanta
    Aug 3, 2011 at 13:26
  • I've updated my post for everyone to know. I'm still not sure why I had that specific error on php -v, but if you install PHP 5.3.6 you will already have JSON installed with php-common (5.3.6, too). I guess I've overwritten that automatically installation with a manual installation of json and it basically lead to errors.
    – Max
    Aug 3, 2011 at 15:56
  • How do you install 5.3.6? When I do yum install php53 I get 5.3.3.
    – Redsandro
    Dec 29, 2012 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .