PHP

json_decode

Jack Moon 2017. 12. 15. 14:42

json_decode


json_decode는 PHP5.2 이상에서만 지원되기 때문에 

CentOS 5의 기본 PHP인 5.16에서는 지원하지 않는다.


이럴경우 pear을 사용하면 된다.


# yum install php-devel
# yum install php-pear
# yum install gcc
# pear install pecl/json

# cd /etc/php.d
# echo "extension=json.so" > json.ini
# /usr/sbin/apachectl restart




만약 아래와 같은 에러가 난다면

running: phpize

Configuring for:

PHP Api Version:         20041225

Zend Module Api No:      20050922

Zend Extension Api No:   220051025

/usr/bin/phpize: /tmp/tmpRenIoa/json-1.2.1/build/shtool: /bin/sh: bad interpreter: 허가 거부됨

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF

environment variable is set correctly and then rerun this script.


ERROR: `phpize' failed


vi /etc/fstab 

-> /tmp 의 noexec 옵션을 제거한 후

mount -oremount /tmp/

후 실행


# pear install pecl/json


다 끝나면 다시 원복

vi /etc/fstab 

-> /tmp 의 noexec 옵션을 추가

mount -oremount /tmp/