PHP编译出错:error while loading shared libraries: libfreetype.so.6
2010 五月 15
1 2 | /home/soft/php_5_3_fpm/sapi/cli/php: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory make: *** [ext/phar/phar.php] Error 127 |
1 2 | /home/soft/php_5_3_fpm/sapi/cli/php: error while loading shared libraries: libpng14.so.14: cannot open shared object file: No such file or directory make: *** [ext/phar/phar.phar] Error 127 |
由于我是编译安装freetype 、jpeg ,png ,gd 库的,因此,库文件默认是在 /usr/local/lib 下面。
将
1 | --with-iconv-dir=/usr/local--with-freetype-dir=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local |
修改为:
1 | --with-iconv-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib |
发现这样以后并没有作用。
于是做链接:
1 2 3 4 5 6 | ln -s /usr/local/include/freetype2 /usr/include/ ln -s /usr/local/lib/libfree* /usr/lib/ ln -s /usr/local/lib/libpng* /usr/lib/ ln -s /usr/local/lib/libjpeg* /usr/lib/ |
这样就行了。
3 Responses
Post a comment








荒野~,我一直找你,找不到能联系你的方式,急死我了,真的,我有个问题真的需要你帮忙,万分感谢:
我装PHP,make出错,
sapi/cli/php: error while loading shared libraries: libpng14.so.14: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.phar] Error 127
我看你的地方有解决的办法了,你是搞的链接,但我不知道在什么地方做链接,怎么做的,帮帮忙吧
十万火急,希望你看到此信息后,联系我:
Ph:15995447660,
QQ:80106051
小弟不胜感激~!
libpng 共享库找不到,可能是你没有安装这个或者安装了但是PHP找不到。按照文章的方法做个链接应该可以了。
PS:我的联系方式,在博客的about 里面写得非常清楚。