Installing PECLjson on CentOS 5.3

I’m writing a bit of PHP that requires the use of the json_encode function. This function is built into php > 5.2 and on Fedora 10, it’s not an issue.

json_encode

PHP 5 >= 5.2.0, PECL json >= 1.2.0

Unfortunately Cent OS 5.3 uses php 5.1.6. No worries, using pecl it’s relatively straight forward .

You want to make sure you have pear and php-devel installed. Pear will provide you with the pecl executable and php-devel provides the executable phpize, both of which are needed to build the json module.

Run the following as root.

# yum install php-pear php-devel

# pecl install json

One more thing… You’ll either need to reconfigure SELinux or disable it.

That should be it.

Enjoy


Posted

in

,

by

Comments

3 responses to “Installing PECLjson on CentOS 5.3”

  1. Tom Penney Avatar
    Tom Penney

    using centos 5.5
    I also needed to add a file:
    /etc/php.d/json.ini

    which contains:
    extension=json.so

    then: service httpd restart

  2. mgargiullo Avatar
    mgargiullo

    Good info. Thanks!

  3. ayafroto Avatar
    ayafroto

    thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *