Install JSON PHP Extension on CentOs / RedHat

25 篇文章 0 订阅

I had numerous requests for info and questions relating to JSON extension in CentOS. To enable these functions in RedHat and CentOs 5, the process is really simple and fast.

NOTE: As of PHP 5.2, json extension is now standard. If you’re running PHP 5.2 or later, or like to upgrade instead, you can skip this!

  1. Ensure you have the necessary dependecies (php, php-pear, php-devel, gcc, make):
    • $ sudo yum install gcc make
    • $ sudo yum install php php-pear php-devel
  2. Use PECL (P HP E xtension C ommunity L ibrary) to download the json package:
    • $ sudo pecl download json
  3. Use PEAR (P HP E xtension and A pplication R epository) to extract and install the extension:
    • $ sudo pear install json-1.2.1.tgz
  4. Create a file in /etc/php.d called “json.ini”, and add the following lines:
    • ; php-json extension
    • extension=json.so
  5. Restart apache (gracefully if you’re running a live site:
    • $ sudo service httpd restart (apachectl graceful)
  6. Check for availability by creating an info.php file in the web root with the following line:
    • <?php phpinfo(); ?>
  7. Load info.php in your browser and check for JSON. You now should be all set, but if it doesn’t appear, verify all of the above steps very carefully.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值