Code Monkey home page Code Monkey logo

Comments (18)

jingjingxyk avatar jingjingxyk commented on June 28, 2024

第一个问题: libtool: unrecognized option-export-dynamic' 执行 make clean重新构建 ,全称应该是--export-dynamic`

第二个问题: https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606 只是警告

可以先下载已经构建好的版本试试

https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0

https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0

https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

oci8 或者 pdo_oci 待验证

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk

第一个问题: libtool: unrecognized option-export-dynamic' 执行 make clean重新构建 ,全称应该是--export-dynamic`

第二个问题: https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606 只是警告

可以先下载已经构建好的版本试试

https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0

https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0

https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606

第一个问题。我 make clean 之后重新构建,还是会发生同样的报错。
还有就是,构建 build-naive-php 这个版本,在 cygwin-build.sh 阶段,在弹出这个警告之后:
Snipaste_2024-03-14_17-19-45
构建过程好像就终止了(还是正常结束了)?
但是这 build 出来的程序目录是这样的:
image
这是没有构建完全吗还是说没有进行构建?。如果我 php.exe -m 就会报错弹窗:
Snipaste_2024-03-14_17-23-08
翻了很多文档,好像对于 windows 上 swoole-cli 的构建很少。

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

第一个问题,我再试试。

第二个问题: 执行打包看看,然后在测试看看

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

我购买了弹性云服务器,再一次验证测试 问题一,结果如下:
image
image

问题二: 构建结果如下

image

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@jingjingxyk

第一个问题: libtool: unrecognized option-export-dynamic' 执行 make clean重新构建 ,全称应该是--export-dynamic`
第二个问题: https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606 只是警告
可以先下载已经构建好的版本试试
https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0
https://github.com/swoole/swoole-cli/releases/tag/v5.1.1.0
https://github.com/swoole/swoole-cli/actions/runs/8262323228/job/22601412406#step:10:1606

第一个问题。我 make clean 之后重新构建,还是会发生同样的报错。 还有就是,构建 build-naive-php 这个版本,在 cygwin-build.sh 阶段,在弹出这个警告之后: Snipaste_2024-03-14_17-19-45 构建过程好像就终止了(还是正常结束了)? 但是这 build 出来的程序目录是这样的: image 这是没有构建完全吗还是说没有进行构建?。如果我 php.exe -m 就会报错弹窗: Snipaste_2024-03-14_17-23-08 翻了很多文档,好像对于 windows 上 swoole-cli 的构建很少。

构建结果是正常的,构建出来的是命令行程序,不应该用双击打开程序。

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk 感谢你的帮助。我这边直接编译已经能够成功了,之前的问题应该是库版本或者库缺失的问题,通过 quickstart 下面的快速安装脚本,已经解决这个问题了。我现在在尝试想要用 OCI8 或者 pdo_oci 。

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk 请问现在 swoole-cli 的编译还不支持 oci8 和 pdo_oci 吗?还是说仅是 Cygwin 的 swoole-cli 的编译不支持 oci8 和 pdo_oci 。我在 cygwin-config.sh 这个脚本中指定配置参数 --with-oci8 和 --with-pdo-oci 。如下图:
Snipaste_2024-03-15_12-10-59
然后在 cygwin-build.sh 阶段,最后会输出:Extension 'swoole' not present 。应该是和这两个参数有关系吧?
Snipaste_2024-03-15_12-11-23
同时在这个 php -m 的输出里,显然有很多模块还没有被构建进来,应该是构建提前结束了?使用打包的这个 sh 脚本,也不会产生文件夹。
Snipaste_2024-03-15_12-19-52

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@jingjingxyk 请问现在 swoole-cli 的编译还不支持 oci8 和 pdo_oci 吗?还是说仅是 Cygwin 的 swoole-cli 的编译不支持 oci8 和 pdo_oci 。我在 cygwin-config.sh 这个脚本中指定配置参数 --with-oci8 和 --with-pdo-oci 。如下图: Snipaste_2024-03-15_12-10-59 然后在 cygwin-build.sh 阶段,最后会输出:Extension 'swoole' not present 。应该是和这两个参数有关系吧? Snipaste_2024-03-15_12-11-23 同时在这个 php -m 的输出里,显然有很多模块还没有被构建进来,应该是构建提前结束了?使用打包的这个 sh 脚本,也不会产生文件夹。 Snipaste_2024-03-15_12-19-52

  1. 支持 oci8 和 pdo_oci 目前还没有验证过,待编译验证(做法: 下载Extension for Oracle Database扩展,扩展下载好了,把扩展源码拷贝到 ext 目录,即可进行编译验证。建议用experiment 分支来验证
  2. Extension 'swoole' not present 出现这个是因为,swoole 源码不存在,需要拉取一下。 (拉取子模块git submodule update --init
  3. 通过截图,你只是构建了默认php ,再次执行bash ./sapi/scripts/cygwin/cygwin-config.sh 注意看预处理提示

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk 我发现为什么之构建了一部分 PHP 扩展了,原来是因为 cygwin-config.sh 这个文件 configure 中的参数项行与行之间不能有空行,也就是回车,回车被当作了结束,所以只 configure 了一部分参数项,正好启用 swoole 扩展的参数项就是在空行后面,导致没有被 configure 进去。也就导致输出了 swoole 扩展不存在这个问题。
image
这些配置项行与行之间不能有空行,这么简单的问题我刚注意到。十分感谢你的帮助。

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk pdo-oci 好像找不到 sdk 下 include 目录的路径,oci8 在 configure 阶段 check for pcntl 会检测失败

instantclient 目录,如下图所示,包含了 basc 目录和 sdk 目录:

image-20240315200012811

--with-pdo-oci 参数,直接书写 Oracle Instant Client 目录路径:--with-pdo-oci=/cygdrive/f/instantclient ,如下图所示:

image-20240315195911145

在 configure 阶段会报错输出以下内容:

checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... /cygdrive/f/instantclient :/cygdrive/f/instantclient:
checking if that is sane... yes
checking Oracle version... configure: error: Oracle-OCI needed libraries not found under /cygdrive/f/instantclient

如下图所示:

image-20240315200655914

--with-pdo-oci 参数,在 Oracle Instant Client 目录路径前面加上 instantclient, 即:

--with-pdo-oci=instantclient,/cygdrive/f/instantclient ,如下图所示:

![image-20240315200542354](Cygwin 构建 swoole-cli 的 pdo-oci md.assets/image-20240315200542354.png)

在 configure 阶段会报错输出以下内容:

checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... instantclient,/cygdrive/f/instantclient :instantclient,/cygdrive/f/instantclient:
checking if that is sane... yes
checking for oci.h... configure: error: I'm too dumb to figure out where the include dir is in your instant client install

如下图所示:

image-20240315200542354

我不知道哪种写法是正确的,第一种:--with-pdo-oci=/cygdrive/f/instantclient ,还是第二种:--with-pdo-oci=instantclient,/cygdrive/f/instantclient 。这两种写法我都设置了 ORACLE_HOME 环境变量为 instantclient 目录的路径,但好像都没有作用。我感觉第二种写法是正确的,但是不知道为什么会找不到 include 目录。

如果使用 oci8 扩展,在 configure 阶段的 check for foek 时,就会显示 noconfigure: error: pcntl: fork() not supported by this platform 。使用 pdo-oci 扩展的话这个检测可以过去,就是后面那样找不到 include dir。

image-20240315201202867

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@jingjingxyk pdo-oci 好像找不到 sdk 下 include 目录的路径,oci8 在 configure 阶段 check for pcntl 会检测失败

instantclient 目录,如下图所示,包含了 basc 目录和 sdk 目录:

image-20240315200012811

--with-pdo-oci 参数,直接书写 Oracle Instant Client 目录路径:--with-pdo-oci=/cygdrive/f/instantclient ,如下图所示:

image-20240315195911145

在 configure 阶段会报错输出以下内容:

checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... /cygdrive/f/instantclient :/cygdrive/f/instantclient:
checking if that is sane... yes
checking Oracle version... configure: error: Oracle-OCI needed libraries not found under /cygdrive/f/instantclient

如下图所示:

image-20240315200655914

--with-pdo-oci 参数,在 Oracle Instant Client 目录路径前面加上 instantclient, 即:

--with-pdo-oci=instantclient,/cygdrive/f/instantclient ,如下图所示:

![image-20240315200542354](Cygwin 构建 swoole-cli 的 pdo-oci md.assets/image-20240315200542354.png)

在 configure 阶段会报错输出以下内容:

checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... instantclient,/cygdrive/f/instantclient :instantclient,/cygdrive/f/instantclient:
checking if that is sane... yes
checking for oci.h... configure: error: I'm too dumb to figure out where the include dir is in your instant client install

如下图所示:

image-20240315200542354

我不知道哪种写法是正确的,第一种:--with-pdo-oci=/cygdrive/f/instantclient ,还是第二种:--with-pdo-oci=instantclient,/cygdrive/f/instantclient 。这两种写法我都设置了 ORACLE_HOME 环境变量为 instantclient 目录的路径,但好像都没有作用。我感觉第二种写法是正确的,但是不知道为什么会找不到 include 目录。

如果使用 oci8 扩展,在 configure 阶段的 check for foek 时,就会显示 noconfigure: error: pcntl: fork() not supported by this platform 。使用 pdo-oci 扩展的话这个检测可以过去,就是后面那样找不到 include dir。

image-20240315201202867

写法是否正确,进入扩展目录看描述,看例子就能判断,是否正确 。参考: https://www.php.net/pdo_ocihttps://www.php.net/manual/en/oci8.installation.php

方法一: 应该找到 cygwin 环境下对应的 instantclient库 ,这里没有搜到https://cygwin.com/cgi-bin2/package-grep.cgi?grep=instantclient
方法二: cygwin 环境下编译 instantclient ,无源码https://www.oracle.com/cn/database/technologies/instant-client/downloads.html
方法三: 使用odbc , https://www.oracle.com/cn/database/technologies/releasenote-odbc-ic.html ; cygwin 环境中源码编译unixODBC库。 https://github.com/lurcher/unixODBC/blob/master/README.CYGWIN

使用那种,我也不确定,需要实验验证。

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk
之前所说的那个找不到 include dir 的报错已经解决了。原因是因为 pecl 上面提供的 pdo_oci 扩展很久没有更新了,相比于 php 源码中提供的 pdo_oci 扩展落后很多个版本,所以扩展中的导致 config.m4 文件和 Oracle Instant Client 目录结构没有对应上。

在新版的 php 当中,--with-pdo-oci=instantclient,/path/to/client 。这个配置项这样配置应该是没有问题的。
image-20240316132949356

昨天看了一晚上 pdo_oci 扩展的 config.m4 文件,得出了上面的结论。

现在好像目录都能找到了但是又出现了新的问题,如下所示:

checking whether to enable PDO support... yes
checking for MySQL support for PDO... yes
checking for the location of libz... no
checking for MySQL UNIX socket location... no
checking for PDO includes... /cygdrive/f/last/swoole-cli/ext
checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... instantclient,/cygdrive/f/instantclient
checking if that is sane... yes
checking size of long... (cached) 8
checking if we're at 64-bit platform... yes
checking Oracle version... 21.1
checking for oci.h... /cygdrive/f/instantclient/sdk/include
checking for OCIEnvCreate in -lclntsh... no
checking for OCIEnvNlsCreate in -lclntsh... no
checking for OCIStmtFetch2 in -lclntsh... no
checking for OCILobRead2 in -lclntsh... no
checking for PDO includes... (cached) /cygdrive/f/last/swoole-cli/ext
checking for PostgreSQL support for PDO... no
checking for PostgreSQL support... no
checking for phar archive support... yes
checking for phar openssl support... yes
checking whether to enable POSIX-like functions... yes
checking for sys/mkdev.h... no
checking for sys/sysmacros.h... yes
checking for seteuid... no
checking for setegid... no
checking for setsid... no
checking for getsid... no
checking for getpgid... no
checking for ctermid... no
checking for mkfifo... no
checking for mknod... no
checking for setrlimit... no
checking for getrlimit... no
checking for getgroups... no
checking for makedev... no
checking for initgroups... no
checking for getgrgid_r... no
checking for working ttyname_r() implementation... no, posix_ttyname() will be thread-unsafe
checking for utsname.domainname... no
checking for libedit readline replacement... no
checking for readline support... yes
checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... no
checking for readline in -lreadline... no
configure: error: readline library not found

感觉这一段输出中的:

  • checking for OCIEnvCreate in -lclntsh... no
    checking for OCIEnvNlsCreate in -lclntsh... no
    checking for OCIStmtFetch2 in -lclntsh... no
    checking for OCILobRead2 in -lclntsh... no

这四条信息应该是最后导致错误 readline library not found 产生的原因。

image-20240316124318903

从这段信息来看是我不太确信是因为我环境变量配置的仍然有问题,导致它最终还是没有找到 lclntsh 从而导致报错?;还是说其实 Oracle Instant Client 这个客户端库在 cygwin 上就是不受支持的,哪怕 Cygwin 模拟了一个 linux 的环境同样没有办法直接使用适用于 linux 的 Oracle Instant Client 库?

还有就是之前所说的如果开启 oci8 扩展就会产生 opcache 不支持、pcntl 不支持这两个问题。想用 oci8 应该也是不太可能了。

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@jingjingxyk 之前所说的那个找不到 include dir 的报错已经解决了。原因是因为 pecl 上面提供的 pdo_oci 扩展很久没有更新了,相比于 php 源码中提供的 pdo_oci 扩展落后很多个版本,所以扩展中的导致 config.m4 文件和 Oracle Instant Client 目录结构没有对应上。

在新版的 php 当中,--with-pdo-oci=instantclient,/path/to/client 。这个配置项这样配置应该是没有问题的。 image-20240316132949356

昨天看了一晚上 pdo_oci 扩展的 config.m4 文件,得出了上面的结论。

现在好像目录都能找到了但是又出现了新的问题,如下所示:

checking whether to enable PDO support... yes
checking for MySQL support for PDO... yes
checking for the location of libz... no
checking for MySQL UNIX socket location... no
checking for PDO includes... /cygdrive/f/last/swoole-cli/ext
checking Oracle OCI support for PDO... yes
checking Oracle Install-Dir... instantclient,/cygdrive/f/instantclient
checking if that is sane... yes
checking size of long... (cached) 8
checking if we're at 64-bit platform... yes
checking Oracle version... 21.1
checking for oci.h... /cygdrive/f/instantclient/sdk/include
checking for OCIEnvCreate in -lclntsh... no
checking for OCIEnvNlsCreate in -lclntsh... no
checking for OCIStmtFetch2 in -lclntsh... no
checking for OCILobRead2 in -lclntsh... no
checking for PDO includes... (cached) /cygdrive/f/last/swoole-cli/ext
checking for PostgreSQL support for PDO... no
checking for PostgreSQL support... no
checking for phar archive support... yes
checking for phar openssl support... yes
checking whether to enable POSIX-like functions... yes
checking for sys/mkdev.h... no
checking for sys/sysmacros.h... yes
checking for seteuid... no
checking for setegid... no
checking for setsid... no
checking for getsid... no
checking for getpgid... no
checking for ctermid... no
checking for mkfifo... no
checking for mknod... no
checking for setrlimit... no
checking for getrlimit... no
checking for getgroups... no
checking for makedev... no
checking for initgroups... no
checking for getgrgid_r... no
checking for working ttyname_r() implementation... no, posix_ttyname() will be thread-unsafe
checking for utsname.domainname... no
checking for libedit readline replacement... no
checking for readline support... yes
checking for tgetent in -lncurses... no
checking for tgetent in -ltermcap... no
checking for readline in -lreadline... no
configure: error: readline library not found

感觉这一段输出中的:

* checking for OCIEnvCreate in -lclntsh... no
  checking for OCIEnvNlsCreate in -lclntsh... no
  checking for OCIStmtFetch2 in -lclntsh... no
  checking for OCILobRead2 in -lclntsh... no

这四条信息应该是最后导致错误 readline library not found 产生的原因。

image-20240316124318903

从这段信息来看是我不太确信是因为我环境变量配置的仍然有问题,导致它最终还是没有找到 lclntsh 从而导致报错?;还是说其实 Oracle Instant Client 这个客户端库在 cygwin 上就是不受支持的,哪怕 Cygwin 模拟了一个 linux 的环境同样没有办法直接使用适用于 linux 的 Oracle Instant Client 库?

还有就是之前所说的如果开启 oci8 扩展就会产生 opcache 不支持、pcntl 不支持这两个问题。想用 oci8 应该也是不太可能了。

需要确认Oracle Instant Client 是否支持cygwin 环境,我在Oracle 官网上没有找到相关信息 https://www.google.com/search?q=Oracle+Instant+Client+for+cygwin+

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk
image
如果要创建 pdo_oci 扩展和 oci8 扩展,那么在 sapi/src/builder/extension 创建扩展之后,要在扩展里面指定依赖库之后,然后还需要 library 目录下创建下面这种格式来进行构建吗?
image

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@jingjingxyk image 如果要创建 pdo_oci 扩展和 oci8 扩展,那么在 sapi/src/builder/extension 创建扩展之后,要在扩展里面指定依赖库之后,然后还需要 library 目录下创建下面这种格式来进行构建吗? image

linux 、macos 环境下是需要这样做的,cygwin 环境下不需要

from swoole-cli.

vkviyu avatar vkviyu commented on June 28, 2024

@jingjingxyk 我一开始是想用 Cygwin 的。因为它很方便,但是恰巧没有我要用的 pdo_oci 和 oci8 扩展,然后就想办法解决,看了 Cygwin 的构建编译阶段的几个 sh 脚本,Cygwin 下应该是不走 builder 目录下的 extension 和 library ,直接走 ext 目录吧。但是后面就遇到了之前所说的问题。好像在 Cygwin 下只是在 config.sh 中指定 pdo_oci 扩展和 oci8 扩展的 Oracle Instant Client 目录,走不下去。没办法了只能转向 wsl 或者 linux 这种了。结果发现一样的过不了 Oracle Instant Client 这一关,不过好在还有点思路能尝试。还是说在 Cygwin 环境中也需要将 oracle instant client 集成进来,而不能单纯的只是在 config.sh 中的 --with-pdo-oci 这个参数中指定 oracle instant client 库的目录。

from swoole-cli.

jingjingxyk avatar jingjingxyk commented on June 28, 2024

@vkviyu 真正的问题在于oracle instant client 没有开放源码,官方仅提供可动态加载的二进制库

from swoole-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.