Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => all application on unix knowledges by golfreeze => Topic started by: golfreeze on มกราคม 11, 2012, 04:42:27 PM

Title: ลง php5-json ผ่าน pear ใน centos
Post by: golfreeze on มกราคม 11, 2012, 04:42:27 PM
  1. ก่อนอื่นต้องมี package php-pear กับ php-devel ก่อนนะครับถ้ายังไม่มีก็จัดโลด

      $ sudo yum install php php-pear php-devel
      $ sudo yum install gcc make

   2. Use PECL to download the json package:

      $ sudo pecl download json

   3. Owing to some odd default memory settings we can’t download and install the package with PECL, we have to use PEAR:

      $ sudo pear install json-1.2.1.tgz

      PEAR will then trundle through and handle the configure, make and make install commands for you
   
   4. เชคในfolder ว่ามี json.ini ยัง /etc/php.d called json.ini, containing the following:

      ; php-json package - http://pecl.php.net/package/json
      extension=json.so

   5. Reload apache 1 รอบ :

      #service httpd reload

   6. เทสโดยรัน บน shell ดูครับ

      #php -r 'var_dump(function_exists("json_encode"));'

      ถ้า return ออกมาได้ค่าว่า "bool(true)" ก็แสดงว่า work ละครับผม