我一直在尝试在 Macos 上安装/编译 php7.4 的 php-firebird 驱动程序,但到目前为止还没有成功。
驱动程序存储库中存在一个未解决的问题,但在帮助方面没有太多进展。https://github.com/FirebirdSQL/php-firebird/issues/6 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
关于布尔数据类型的错误(在 Firebird 3.0 中引入)清楚地表明您的 PHP 库需要 Firebird 3+,但您为其提供了 FB 2.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 命令行 utils 上进行同样的猜测)
快速检查可能会开放ibase.h
在该位置并检查 API 版本声明:现在在我的 Windows 框中,第三个非注释行如下:#define FB_API_VER 21
在安装了 Firebird 2.1.7 的文件夹中的该文件中。
或者调整CPPFLAGS
and LDFLAGS
也许还有其他变量指向特定的 3.x 版本源,而不是一些模糊的“默认”或“当前”。
当然,这一标志调整仅在您需要将 FB 2.5 源安装为“当前”源以用于 FB 3 源的某些其他目的的情况下才有意义。我不知道类似 UNIX 的情况,但至少在 Windows 上,安装/运行不同版本甚至相同版本的多个 Firebird 服务器是微不足道的,有时甚至很方便。对于一些未来的读者来说,情况也可能发生。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)