1.下载源文件包:
wget http://www.aurore.net/projects/php-json/
2.解压
tar xvjf php-json-ext-1.2.0.tar.bz2
立即学习“PHP免费学习笔记(深入)”;
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
                        
                        Easily find JSON paths within JSON objects using our intuitive Json Path Finder
                                30
                            
                        
                    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安装的全部步骤。
                        
                        PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号