Published on Sake.in.th (https://sake.in.th)

หน้าแรก > หน้าหลัก > Compile WSO2 WSF/PHP บน FreeBSD

Compile WSO2 WSF/PHP บน FreeBSD [1]

เขียนโดย sake [2] เมื่อ 2008-11-21 17:09

หลายคนคงเคยใช้ WSO2 Web Services Framework for PHP ( http://wso2.org/projects/wsf/php [3] ) ซึ่งเป็น Framework ตัวนึงที่น่าใช้ทีเดียว ในการลงบน linux นั้น ไม่ใช่เรื่องยาก ไม่ว่าจะลงโดย binary หรือการ compile เอง แต่เนื่องจาก kernel ของ Freebsd และ Linux มีการเรียก IO ใช้ต่างกัน ในรายละเอียด ทำให้ library บางอย่างไม่มี เกิด compilation error ได้

  1. # wget http://builder.wso2.org/~wso2wsf/wso2-wsf-php-src-snapshot.tar.gz [4]
  2. # tar zxvf wso2-wsf-php-src-snapshot.tar.gz
  3. # cd wso2-wsf-php-src-2.0.0
  4. # ./configure
  5. # make
  6. uuid_gen_unix.c: In function `axutil_uuid_get_mac_addr':
  7. uuid_gen_unix.c:337: error: `SIOCGARP' undeclared (first use in this function)
  8. uuid_gen_unix.c:337: error: (Each undeclared identifier is reported only once
  9. uuid_gen_unix.c:337: error: for each function it appears in.)
  10. *** Error code 1

หาใน google มีคนเจอเหมือนกัน แต่ไม่ได้อยู่ดี เอาเป็นว่าลบทิ้งเลยละกันบรรทัดนั้น -_-''

  1.     memcpy(&(sa->sin_addr), *(he->h_addr_list), sizeof(struct in_addr));
  2. /* คอมเมนต์ซะ
  3.     if (ioctl(s, SIOCGARP, &ar) < 0)
  4.     {
  5.         close(s);
  6.         return NULL;  
  7.     }
  8. */
  9.     close(s);
  10.     if (!(ar.arp_flags & ATF_COM))
  11.         return NULL;
  1. # make

อีกอัน เหมือน ftime() ไม่มี ต้องลง libcompat

  1. # cd /usr/ports/misc/compat5x
  2. # make install clean

จากนั้น บังคับโหลดไลบรารี่ เพิ่ม LDFLAGS ไปซะ

  1. # LDFLAGS="-lcompat" ./configure
  2. # make
  3. # make install

มีหา library ไม่ ไปแก้นิดนึง จาก -I/usr/include เป็น -I /usr/local/include ก้อผ่าน แต่ใช้ได้มั้ยเดี๋ยว รายงานตอนตอไปว่ามีปัญหาหรือไม่

Tags: 
websevices [5]
freebsd [6]
PHP [7]
wso2 [8]

Source URL (modified on 2008-11-21 17:09): https://sake.in.th/node/71

Links
[1] https://sake.in.th/blog/compile-wso2-wsfphp-%E0%B8%9A%E0%B8%99-freebsd
[2] https://sake.in.th/users/sake
[3] http://wso2.org/projects/wsf/php
[4] http://builder.wso2.org/~wso2wsf/wso2-wsf-php-src-snapshot.tar.gz
[5] https://sake.in.th/tags/sitetags/websevices
[6] https://sake.in.th/tags/sitetags/freebsd
[7] https://sake.in.th/category/sitetags/php
[8] https://sake.in.th/tags/sitetags/wso2