Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've had to upgrade my CentOS PHP package to 5.2.10 to enable the JSON extension, but it's not gone 100% smoothly. Naturally..

I used this guide:

On completing "yum update", "php -v" showed a bunch of extension errors so I updated those using "pecl upgrade [package]". That reduced the number of warnings down to one:

PHP Warning: Module 'readline' already loaded in Unknown on line 0

I've tried updating this package individually but neither yum or pecl can find it (not installed apparently) despite the sitting in /usr/lib/php/modules/. I know you need to compile php using -readline, is this now my only option: a complete recompile from fresh?

I hope not.

Anyone able to help? Thanks.


5.3 is indeed out and works fine with plesk. To get JSON running had to:

  • Update yum with this Plesk / CentOS focused rpm
  • Disable plesk sitebuilder functionality (conflict with new PHP version)
  • pecl uninstall / reinstall of json package
  • double checked it was being called from etc/php.d/
  • chmod 755 /usr/lib/php/modules/
  • service httpd restart

I know json is included in php-common from 5.2 upwards, but this seemed to fix it regardless. Uninstalling via pecl left it working too.

share|improve this question
up vote 1 down vote accepted

If an even newer PHP is not a problem (PHP 5.3), it is now available for CentOS 5.6.

The packages are named php53 instead of php, and the json module is part of the php53-common package.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.