首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >macos上PHP-7.4的firebird驱动程序编译问题

macos上PHP-7.4的firebird驱动程序编译问题
EN

Stack Overflow用户
提问于 2021-05-20 05:19:48
回答 1查看 188关注 0票数 0

我一直试图在macos上安装/编译php7.4的php7.4驱动程序,但到目前为止没有成功。

在司机回购中存在一个问题,但在帮助方面没有太多进展。https://github.com/FirebirdSQL/php-firebird/issues/6

到目前为止我这么做了:

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 .
  1. 安装了https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/FirebirdCS-2.5.9-27139-x86_64.pkg (也尝试使用firebird 3.x)
  2. 将此回购克隆到了.这就是错误的开始,

代码语言:javascript
复制
/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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-20 17:06:52

有关布尔型数据类型的错误--在FireBird3.0中引入--清楚地表明您的PHP库期望Firebird 3+,但是您给它提供了FB2.5或更早的源代码。

代码语言:javascript
复制
CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Versions/Current/Headers 
LDFLAGS=-L/Library/Frameworks/Firebird.framework/Versions/Current/Libraries 

我认为在您安装FB2.5之后,您提到的Versions/Current是作为指向2.5源的符号链接创建的。如果您确实安装了3.0源代码-然后检查Versions/Current符号链接指向的位置,并在需要时将其更改为3.0源代码( Linux上的ln -s,在BSD命令行实用程序上猜相同)

快速检查可能会在该位置打开ibase.h,并检查API版本声明:现在在我的Windows上,第三行非评论行如下:该文件中的#define FB_API_VER 21位于安装了FireBird2.1.7的文件夹中。

或者,调整CPPFLAGSLDFLAGS以及其他变量以指向特定的3.x版本源,而不是一些模糊的“默认”或“当前”。

当然,这个标志的调整只有在您需要FB2.5源安装为“当前”源的情况下才有意义,因为FB3源有其他一些用途。我不知道UNIX的喜好,但至少在Windows上,安装/运行不同版本甚至相同版本的Firebird服务器是微不足道的,有时也很方便。对一些未来的读者来说,情况可能也是如此。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67614393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档