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

It's OK (compatible) to install PECL native JSON (from here) in PHP 5.0.4, on a production server running FC4 where unfortunately I cannot update PHP to at least 5.2 ?
If there is a good chance to screw up PHP instalation on the server, I will not try to install it, and I will stick to Service JSON ( http :// )

In documentation ( http :// ) I have found:
A simple ./configure; make; make install should do the trick. Make sure to add an line to your php.ini/php.d.
(but I can't find anythink about compatible versions of PHP)

Thank you.
(Please don't tell me to update the OS and PHP, beacause it's not my decision :( )

share|improve this question

the PECL extension will work with any PHP versions >= 4.3.0 so if your php version on FC4 is that you should be able to install it

share|improve this answer

PECL extensions need to match the version of the PHP build; the easiest way I've found for using PECL is to use the download function and build the rest yourself.

  • cd /usr/src
  • /path/to/pecl download json
  • tar -xzvf json.tar.gz (or whatever is downloaded by command above)
  • cd json
  • /path/to/phpize
  • ./configure --with-php-config=/path/to/php-config --with-json
  • make

Then skip make install and copy ./modules/ to /path/to/php/lib/modules (modules dir may need creating)

Then edit your php.ini file to add

Restart PHP, if it doesn't work, just comment the extension line you added, and you're back to normal. Very low impact and you have total control over the entire process.

Hope this helps, but the above is off the top of my head and doesn't constitute the only way to do things.


PS You could always install the version that's in production on your test machine and build the extension that way.

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.