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 => Os kernel การปรับแต่ง เพิ่มเติม ลงโปรแกรม บน OS และ ControlPanel Directadmin,Cloud server => Topic started by: golfreeze on เมษายน 21, 2018, 06:31:46 AM

Title: freebsd 9.2 Warning: imagejpeg() [function:imagejpeg]: gd-jpeg: JPEG library rep
Post by: golfreeze on เมษายน 21, 2018, 06:31:46 AM
วันนี้เจอปัญหาที่เป็น imagejpeg ไม่สามารถ resize รูปผ่าน php function resize ได้ครับ
เป็น warning + error นี้ : Warning: imagejpeg() [function:imagejpeg]: gd-jpeg: JPEG library reports unrecoverable error

ตรวจสอบดูพบว่า jpeg packet ที่ลงไม่ได้ผ่าน php-gd เลยต้องทำการ ลบ ออก แล้วทำการตั้งค่า path ของ jpeg lib ใหม่
จากเดิมเป็น /usr/local/lib ให้เปลี่ยนเป็น /usr/local ในไฟล์ configure.php5x

เริ่มกันเลย
Login as root
Update ports
[root@lala ~]# portsnap fetch update
Delete currently installed JPEG library
[root@lala ~]# pkg_info | grep jpeg
[root@lala ~]# pkg_delete jpeg

ถ้าลบไม่ออกให้ใส่ -r เลยครับ
#pkg_delete -r jpeg

##Install jpeg library with custombuild
##Edit your configuration script for php in custombuild. Add or edit values as bellow. Notice that path is not /usr/local/lib anymore.

#cd /usr/local/directadmin/custombuild/configure/ap2
#vi configure.php5x

–with-gd \
–with-jpeg-dir=/usr/local \
Rebuild PHP with custombuild
[root@lala ~]# cd /usr/local/directadmin/custombuild
[root@lala /usr/local/directadmin/custombuild]# ./build php n
When build is complete, restart Apache and try it again. It should work.
[root@lala ~]# /usr/local/etc/rc.d/httpd restart

ขอบคุณลิ้งจาก
https://www.geekytuts.net/directadmin/directadmin-and-wrong-jpeg-library-version-on-freebsd/