Home  >  Article  >  php教程  >  MAC下编译PHP5.5.7问题:configure: error: freetype.h not foun

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

WBOY
WBOYOriginal
2016-06-06 19:59:331095browse

执行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

执行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


也不知道是谁不对。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn