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

时间:2014-09-15 06:19:56

标签: php macos postgresql makefile

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

从[博客](http://blog.rupey.org/post/63221360055/adding-postgres-support-to-php-on-os-x-mavericks)开始执行以下步骤...在错误之间修复,并且达到' make'。

执行'制作'我得到以下错误。     ------ ------ ERROR

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:致命错误:&#39; zend_config.h&#39;找不到文件确保配置php源。即在您复制所有文件的目录中运行./configure - greg Jan 19&#39; 13 at 2:41

虽然,我已经运行./configure,但仍然会出现上述错误。

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

提前致谢!

1 个答案:

答案 0 :(得分:12)

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

前往您的终端并输入

&#34; sudo cp -r / usr / include / php /Applications/MAMP/bin/php/php5.x.x/include /"

将粗体字样替换为您正在使用

的php版本

然后运行make命令