【问题标题】:How to fix, 'PHP' make, in Mac OS X (10.9.4)?如何在 Mac OS X (10.9.4) 中修复“PHP”制作?
【发布时间】:2014-11-08 14:48:48
【问题描述】:

我正在为 OS X Mavericks (10.9.4) 上的 PHP 添加 postgres 支持。

遵循 [blog] (http://blog.rupey.org/post/63221360055/adding-postgres-support-to-php-on-os-x-mavericks) 中的步骤...在错误之间进行了修复,并且一直到达“make”。

在执行“make”时,出现以下错误。 ------错误-----

users-mbp:pdo_pgsql RK$ pwd
/usr/include/php/ext/pdo_pgsql

users-mbp:pdo_pgsql RK$ make
/bin/sh /usr/include/php/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext          -I. -I/usr/include/php/ext/pdo_pgsql -DPHP_ATOM_INC -I/usr/include/php/ext/pdo_pgsql/include -I/usr/include/php/ext/pdo_pgsql/main -I/usr/include/php/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Applications/Postgres.app/Contents/Versions/9.3/include  -DHAVE_CONFIG_H  -g -O2   -c /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c -o pdo_pgsql.lo 
 cc -I/usr/include/php/ext -I. -I/usr/include/php/ext/pdo_pgsql -DPHP_ATOM_INC -I/usr/include/php/ext/pdo_pgsql/include -I/usr/include/php/ext/pdo_pgsql/main -I/usr/include/php/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Applications/Postgres.app/Contents/Versions/9.3/include -DHAVE_CONFIG_H -g -O2 -c /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c  -fno-common -DPIC -o .libs/pdo_pgsql.o
In file included from /usr/include/php/ext/pdo_pgsql/pdo_pgsql.c:25:
In file included from /usr/include/php/main/php.h:34:
/usr/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found
# include <zend_config.h>
      ^
1 error generated.
make: *** [pdo_pgsql.lo] Error 1
users-mbp:pdo_pgsql RK$


------ERROR------}

但是,我可以在以下目录中找到文件:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/Zend/zend.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php/Zend/zend.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/Zend/zend_config.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php/Zend/zend_config.h

在 [post] (Having problems while try to install OAUTH with PECL in MAMP on mac OS lion) 下看到了类似的问题。 - 这表明:

如果您收到以下 /Applications/MAMP/bin/php/php5.4.4/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found 确保您配置php源码。即在您复制所有文件的目录中运行 ./configure – greg 2013 年 1 月 19 日 2:41

虽然我已经运行了./configure,还是出现上面的错误。

可以帮助我了解我缺少什么吗?

提前致谢!

【问题讨论】:

  • 看来zend.h不在/usr/include/php/Zend/,而是在/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php/Zend/。
  • 实际上,“zend.h”找不到“zend_config.h”。...确实,zend_config.h 不在:/usr/include/php/Zend 下。而是我看到了以下两个文件,位于:/usr/include/php/Zend zend_config.w32.h zend_config.nw.h -我应该手动将 zend_config.h 复制到上述位置吗?
  • 你可以试试或者使用他们所在的路径;这些文件可能也依赖于其他文件。

标签: php macos postgresql makefile


【解决方案1】:

所以我找到了适合我的解决方案。

前往您的终端并输入

"sudo cp -r /usr/include/php /Applications/MAMP/bin/php/php5.x.x/include/"

用你正在使用的php版本替换粗体字

然后运行 ​​make 命令

【讨论】:

  • 这救了我!默认的 php 源缺少所有这些标头。
  • 谢谢。对我来说,它已将所有内容复制到包含文件夹但应该包含/php 所以“sudo cp -r /usr/include/php/Applications/MAMP/bin/php/php7.0.0/include/php”
  • 请注意@fdrv 的上述评论,递归 cp 使用大写 -R。
猜你喜欢
  • 1970-01-01
  • 2014-11-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-21
  • 2011-02-01
  • 2011-10-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多