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

Tags:

3 Responses to “Installing PECLjson on CentOS 5.3”

    Error thrown

    Call to undefined function ereg()