在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题 [英] Issues compiling firebird driver for PHP-7.4 on macos

查看:21
本文介绍了在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在MacOS上安装/编译php7.4的php-Firebird驱动程序,但到目前为止还没有成功。

驱动程序回购中存在一个未解决的问题,但在帮助方面没有进行太多操作。 https://github.com/FirebirdSQL/php-firebird/issues/6

到目前为止,我这样做了:

  1. 已安装https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/FirebirdCS-2.5.9-27139-x86_64.pkg(也尝试使用Firebird 3.x)
  2. 将此存储库复制到php-firebird
  3. CDphp-firebird
  4. phpize
  5. CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Versions/Current/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Versions/Current/Libraries ./configure
  6. 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的文件夹中的该文件中。

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

当然,只有在您需要将FB2.5信号源安装为FB3信号源的当前信号源以用于某些其他目的的情况下,此标记调整才有意义。我不知道是否喜欢Unix,但至少在Windows上,安装/运行不同甚至相同版本的几个Firebird服务器是微不足道的,有时还很方便。对于一些未来的读者来说,情况可能也是如此。

这篇关于在MacOS上编译适用于PHP-7.4的Firebird驱动程序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆