Home  >  Article  >  php教程  >  如何实现centos环境中的PHP JSON安装

如何实现centos环境中的PHP JSON安装

WBOY
WBOYOriginal
2016-06-13 11:09:57965browse

1.下载源文件包:

wget http://www.aurore.net/projects/php-json/

2.解压

tar xvjf php-json-ext-1.2.0.tar.bz2

3.进入目录

cd php-json-ext-1.2.0

4.初始化PHP环境

phpize

报错了:phpize commend not found

PHP JSON安装之前需要安装phpize
这个可以在yum中安装
yum -y install php-devel

如果还不能完成PHP JSON安装,说明你的编译工具有问题,安装一下就可以了
yum -y install autoconf
yum -y install automake
yum -y install libtool

运行phpize
(成功了)

5../configure

6.make

7.makeinstall

8.查看PHP JSON安装有没有成功

find / -name '*json.so'

./usr/lib/php/modules/json.so
说明已经有了

9.修改php.ini

我的是在php.ini 中include一个文件夹 /etc/php.d

在这个文件中添一个json.ini
vim json.ini

内容如下:
extension=json.so

10.重启服务

11.phpinfo()中您将看到

json support enabled
json version

以上就是PHP JSON安装的全部步骤。


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn