Author Topic: ลง php5-json ผ่าน pear ใน centos  (Read 4850 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ลง php5-json ผ่าน pear ใน centos
« 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 ละครับผม