You may skip the rest of the post if you already have PHP 5.2.0. Keep on reading if you have PHP 5.0/5.1 on Fedora Core 4 and want JSON functionality.
Good news is that the php-json has an RPM available in fedora-extras. You don’t need do any thingamagic of installing the RPM by hand. Instead use yum to install it seamlessly from the fedora extras repository
(Assuming that You have su privileges)
Step1. Navigate to the /etc/yum.repos.d directory. Check if you have a file called fedora-extras.repo. This file contains the required information for yum to look up the extras repository
Step 2. If you do not have the file then create the file with the following text:
name=Fedora Extras $releasever - $basearch
If you have the file then make sure the “enabled” flag is set to 1. Extras are normally disabled.
Step 3. Run a yum search command as “yum search php-json”. If your fedora-extras.repo is set correctly then you will see a matching result as:
Step 4. If all looks good, run the install command as yum install php-json. That’s it. Have fun with JSON. Read the PHP Manual for usage.