Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ://svn.php.net/viewvc/pear/packages/Services_JSON/trunk/ )

In documentation ( http ://aurore.net/projects/php-json/ ) I have found:
A simple ./configure; make; make install should do the trick. Make sure to add an extension=json.so 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

2 Answers 2

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/json.so to /path/to/php/lib/modules (modules dir may need creating)

Then edit your php.ini file to add extension=json.so

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.

Andrew

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

 
discard

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.