有人可以建议如何在 PHP 中启用 json_encode 函数吗?
我全新安装了 Centos 5.6,并且刚刚安装了 Virtualmin。
有人知道接下来要采取的步骤吗?
最佳答案
如 http://www.php.net/manual/en/json.requirements.php
Requirements
There is no installation needed to use these functions; they are part of the PHP core.
编辑:在 comment 中看到还有这个
On RHEL5/CentOS5 add the EPEL repository (http://fedoraproject.org/wiki/EPEL).
After that, installation is as simple as:
sudo yum install php-pecl-json
不知道这是否适用于你的问题,我没有 Centos 服务器...
对于 Ubuntu:
sudo aptitude install php5-json
关于php - 在 PHP 中启用 json_encode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7318191/