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

来源:互联网 发布:php sleep 和 usleep 编辑:程序博客网 时间:2024/04/26 23:30
执行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
0 0
原创粉丝点击