首页 > php教程 > php手册 > 正文

How to add / install JSON support to PHP on CentOS in 10 Ste

WBOY
发布: 2016-06-06 20:01:46
原创
901 人浏览过

http://www.arckid.com/blog/amfphp/how-to-add-install-json-support-to-php-on-centos-in-10-steps/ We are using staging server inside our organization ( CentOS ) to test the applications that we work on. We heavily use AMFPHP based PHP servic

http://www.arckid.com/blog/amfphp/how-to-add-install-json-support-to-php-on-centos-in-10-steps/


We are using staging server inside our organization (CentOS) to test the applications that we work on. We heavily use AMFPHP based PHP services to do communication between business logic and client front end in flash.

Team requested to have native JSON support for PHP and I found a very simple way to do it as following:

  1. Login to shell prompt with user credentials (which allows you to install stuff on server).
  2. Execute command yum update “*php*”
  3. This should update all PHP related components to the latest version. (Assuming you installed yum etc., on CentOS)
  4. Once done that, You will require to install Pear based JSON support by following command.
  5. pecl install json
  6. This will install JSON, simply wait and cross your fingers! If it says OK in last 2 lines, everything is fine so far.
  7. You will also require to enable JSON support in php.ini
  8. Smart way to do that is, create a new file in /etc/php.d/ called json.ini
  9. The file should contain this line: extension=json.so
  10. Finally, restart the HTTP (Apache) Server by command: service httpd restart

Done! Here is the all keyboard actions together, after you logged in:

yum update “*php*”

pecl install json

cd /etc/php.d/

echo “extension=json.so” >> json.ini

service httpd restart

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!