在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题 [英] Issues compiling firebird driver for PHP-7.4 on macos
本文介绍了在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试在MacOS上安装/编译php7.4的php-Firebird驱动程序,但到目前为止还没有成功。
驱动程序回购中存在一个未解决的问题,但在帮助方面没有进行太多操作。 https://github.com/FirebirdSQL/php-firebird/issues/6
到目前为止,我这样做了:
- 已安装
https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/FirebirdCS-2.5.9-27139-x86_64.pkg
(也尝试使用Firebird 3.x) - 将此存储库复制到
php-firebird
- CD
php-firebird
phpize
CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Versions/Current/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Versions/Current/Libraries ./configure
make
...而这就是错误的开始
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:159:24: warning: equality comparison result unused [-Wunused-comparison]
ib_result->stmt_res == NULL;
~~~~~~~~~~~~~~~~~~~~^~~~~~~
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:159:24: note: use '=' to turn this equality comparison into an assignment
ib_result->stmt_res == NULL;
^~
=
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:178:22: warning: equality comparison result unused [-Wunused-comparison]
ib_query->stmt_res == NULL;
~~~~~~~~~~~~~~~~~~~^~~~~~~
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:178:22: note: use '=' to turn this equality comparison into an assignment
ib_query->stmt_res == NULL;
^~
=
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:253:22: error: use of undeclared identifier 'blr_bool'
case blr_bool:
^
/Users/bonovskiSandbox/php-firebird/ibase_query.c:254:34: error: use of undeclared identifier 'SQL_BOOLEAN'
a->el_type = SQL_BOOLEAN;
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:598:22: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:724:25: warning: incompatible pointer types passing 'zend_long *' (aka 'long long *') to parameter of type 'const time_t *' (aka 'const long *')
[-Wincompatible-pointer-types]
res = php_gmtime_r(&Z_LVAL_P(b_var), &t);
^~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h:127:46: note: passing argument to parameter here
struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:790:18: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:795:32: error: use of undeclared identifier 'SQL_BOOLEAN'
var->sqltype = SQL_BOOLEAN;
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:883:18: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:1386:14: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:1985:18: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
/Users/bonovski/Sandbox/php-firebird/ibase_query.c:2012:18: error: use of undeclared identifier 'SQL_BOOLEAN'
case SQL_BOOLEAN:
^
3 warnings and 9 errors generated.
make: *** [ibase_query.lo] Error 1
推荐答案
有关Boolean数据类型的错误-在Firebird 3.0中引入-清楚地表明您的PHP库需要Firebird 3+,但您为其提供了FB2.5或更早版本的源代码。
CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Versions/Current/Headers
LDFLAGS=-L/Library/Frameworks/Firebird.framework/Versions/Current/Libraries
我认为在您安装FB 2.5之后,您提到的Versions/Current
是作为指向2.5源代码的符号链接创建的。如果您确实安装了3.0源代码-然后检查Versions/Current
符号链接指向的位置,如果需要,将其更改为3.0源代码(ln -s
在Linux上,请在您的BSD命令行实用程序上猜测相同的内容)
Quick Check可能会在该位置打开ibase.h
并检查API版本声明:在My Windows box上,当前的第三个非注释行如下:#define FB_API_VER 21
在安装了Firebird 2.1.7的文件夹中的该文件中。
或者调整CPPFLAGS
和LDFLAGS
以及其他变量,使其指向特定的3.x版本来源,而不是某些模糊的默认来源或当前来源。
这篇关于在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文