2011-09-08

configure: error: libpng.(a|so) not found.

近來凍仁會在 CentOS 5.6 x86_64 的環境上編譯 PHP (v5.2.17),也很巧的遇見同樣問題兩次,不過比較詭異的地方是,當初同事是遇到「configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.」的錯誤訊息,但換凍仁接手時就變成「configure: error: libpng.(a|so) not found.」了。

由於環境是 x86_64 (64 bit) 的關係,會同時有 /usr/lib 以及 /usr/lib64 兩函式庫,所以只要把 /usr/lib 裡缺少的東西連結過來即可。
root@centos:~$ ln -s /usr/lib64/libpng.a /usr/lib/ [Enter]
root@centos:~$ ln -s /usr/lib64/libpng.so /usr/lib/ [Enter]

繼續編譯前的 ./configure .. 之後編譯完成就會看到如下的畫面。
root@centos:~$ make [Enter]
......
|--------------------------------------------------------------------|
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
|--------------------------------------------------------------------|
Thank you for using PHP.

參考連結:
apache mysql php gd freetds-Linux系统-Linux系统中文网
[PHP] GD with JPEG / imagejpeg @ FreeBSD @ 第二十四個夏天後 :: 痞客邦 PIXNET ::

0 Feedback:

張貼意見

謝謝您的寶貴意見,凍仁一定會盡快處理 ~^^