php - 如何在 Mac OS X (10.9.4) 中修复 'PHP' make?

标签 php macos postgresql makefile

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

遵循 [博客] ( 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) 下看到了类似的问题。 - 这表明:

If you get the following /Applications/MAMP/bin/php/php5.4.4/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found make sure you configure php sources. i.e. in the directory where you copied all the files run ./configure – greg Jan 19 '13 at 2:41

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

可以帮助我了解我错过了什么吗?

提前致谢!

最佳答案

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

前往您的终端并输入

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

将粗体字替换为您正在使用的 php 版本

然后运行make命令

关于php - 如何在 Mac OS X (10.9.4) 中修复 'PHP' make?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25841906/

相关文章:

sql - Postgresql 位图堆扫描速度慢

php - 使用 MySQL 和 PHP 启动帖子线程的逻辑?

php - MySQL 无法建立连接

php - Laravel 将 POST 请求作为 GET 处理

swift - AVCaptureVideoDataOutput 中的无效键 -> ProfileLevel (macOS)

sql - postgresql 转义引号仍然在数据库中转义

php - Ratchet Symfony2.2

linux - 键盘快捷键在 tkinter 中给我错误

java - Docker 构建在下载期间挂起

hibernate - 什么 Postgres 类型会映射到 hibernate 中 Float 类型的列?