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

本文解决在配置PHP时遇到的Freetype头文件路径不匹配的问题,通过调整链接路径成功解决。具体步骤包括检查配置文件路径处理差异,发现brew安装的Freetype头文件路径与PHP所需路径不同,并通过创建软链接解决路径不匹配问题。

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


也不知道是谁不对。

org.apache.catalina.util.LifecycleBase : Failed to start component [Connector[HTTP/1.1-8443]] org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalina.connector.Connector.startInternal(Connector.java:960) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) [spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at com.eversec.smci.DemoApp.main(DemoApp.java:68) [smms-idccommand-5.5.7.jar:5.5.7] Caused by: java.lang.IllegalArgumentException: Sequence tag error at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:85) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:224) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1108) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:550) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.connector.Connector.startInternal(Connector.java:957) ~[tomcat-embed-core-9.0.12.jar:9.0.12] ... 12 common frames omitted Caused by: java.io.IOException: Sequence tag error at sun.security.util.DerInputStream.getSequence(DerInputStream.java:330) ~[na:1.8.0_221] at sun.security.pkcs12.PKCS12KeyStore.loadSafeContents(PKCS12KeyStore.java:2202) ~[na:1.8.0_221] at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2069) ~[na:1.8.0_221] at java.security.KeyStore.load(KeyStore.java:1445) ~[na:1.8.0_221] at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:160) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:204) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.jsse.JSSEUtil.getKeyManagers(JSSEUtil.java:184) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:112) ~[tomcat-embed-core-9.0.12.jar:9.0.12] ... 17 common frames omitted 什么原因
最新发布
07-05
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值