WEB

PHP JSON 설치

ndlessrain 2014. 5. 13. 21:32
728x90
php json 설치
 
 
wget http://aurore.net/projects/php-json/php-json-ext-1.2.1.tar.bz2
 
tar xvjf php-json-ext-1.2.1.tar.bz2
 
cd php-json-ext-1.2.1
./configure
make
 
cd modules/
cp -pv json.so /usr/lib/php/modules/
 
php.ini
 
extension_dir = "/usr/lib/php/modules"
extension=json.so
 
아파치 재시작
 
/usr/local/apache/bin/apachectl graceful
 
 
php -i | grep json
json
json support => enabled
json version => 1.2.1
 
 
 
php test.php
{"test":100}
 
cat test.php
<?
$val = array("test"=>100);
$out = json_encode($val);
echo $out;
728x90