您的位置:首页 > 编程语言 > PHP开发

MAC下编译PHP5.5.7问题:configure: error: freetype.h not found.

2014-06-06 18:19 453 查看
执行configura时提示

configure: error: freetype.h not found.

freetype明明是使用brew安装了的。也可以查询到这个文件

stk-tianwen:freetype2 hufeiyan$ ls /usr/local/include/freetype2/freetype.h

/usr/local/include/freetype2/freetype.h

stk-tianwen:freetype2 hufeiyan$

搞了半天都通不过。

后来想到搜了一下配置文件

stk-tianwen:php-5.5.7 hufeiyan$ cat configure |grep freetype.h

if test -f "$i/include/freetype2/freetype/freetype.h"; then

as_fn_error $? "freetype.h not found." "$LINENO" 5

if test -f "$i/include/freetype2/freetype/freetype.h"; then

as_fn_error $? "freetype.h not found." "$LINENO" 5

stk-tianwen:php-5.5.7 hufeiyan$

原来他们的路径处理不同,brew安装后头文件路径为/usr/local/include/freetype2/,PHP需要的路径为/include/freetype2/freetype/

PHP认为还要/usr/local/include/freetype2/下面有一个freetype目录

执行命令

ln -s /usr/local/Cellar/freetype/2.5.2/include/freetype2/ /usr/local/Cellar/freetype/2.5.2/include/freetype2/freetype

创建一个链接后,配置通过。

最终配置成功的命令:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-freetype-dir=/usr/local/opt/freetype --with-libxml-dir=/usr/local/opt/libxml2/ --with-png-dir=/usr/local/opt/libpng/ --with-jpeg-dir=/usr/local/opt/jpeg --with-gd=/usr/local/ --with-zlib-dir=/usr/local/zlib/
--with-mcrypt=/usr/local/opt/mcrypt/ --with-mysql=/usr/local/mysql --enable-soap --enable-mbstring=all --enable-pdo --with-pdo-mysql=/usr/local/mysql --with-pgsql=/Applications/Postgres93.app/Contents/MacOS --enable-opcache=no
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐