配置php5.3失败,错误为:找不到freetype.h(但安装了libfreetype6-dev)


Configure php 5.3 fail with error : freetype.h not found (but libfreetype6-dev is installed)

我用以下命令配置了php:

./configure '
--prefix=/opt/phpfcgi-5.3.28 '
--with-pdo-pgsql '
--with-zlib-dir '
--with-freetype-dir=/usr/include/freetype2 '
--with-libpng-dir=/usr/include/libpng '
--with-xpm-dir=/usr '
--enable-mbstring 'ls '
--with-libxml-dir=/usr '
--enable-soap '
--enable-calendar '
--with-curl '
--with-mcrypt '
--with-zlib '
--with-gd '
--with-pgsql '
--disable-rpath '
--enable-inline-optimization '
--with-bz2 '
--with-zlib '
--enable-sockets '
--enable-sysvsem '
--enable-sysvshm '
--enable-pcntl '
--enable-mbregex '
--with-mhash '
--enable-zip '
--with-pcre-regex '
--with-mysql '
--with-mysql-dir=/etc/mysql/ '
--with-pdo-mysql '
--with-mysqli '
--with-jpeg-dir=/usr '
--with-png-dir=/usr '
--enable-gd-native-ttf '
--with-openssl '
--with-libdir=/lib/x86_64-linux-gnu '
--enable-ftp '
--with-kerberos '
--with-gettext '
--enable-cgi '
--with-fpm-user=www-data '
--with-fpm-group=www-data

但如果我尝试编译,我会收到错误消息:

配置:错误:找不到freetype.h

如果收到该消息,即使您安装了libfreetype6dev,也可以尝试以下操作:

mkdir /usr/include/freetype2/freetype
ln -s /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h

在此之后,请重新进行配置。

附加提示:对于某些系统,您必须使用/usr/local/include。。。。