-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在使用 micro:combine 打包 phar 时出现乱码 #479
Comments
什么操作系统/架构?另外如果可以的话最好附上最小复现的 phar 和完整的编译命令。 |
是Linux x86_64 ubuntu |
完整编译指令: bin/spc doctor --auto-fix
bin/spc download --for-extensions=openssl,swoole,zip,pcntl,phar,zstd --with-php=8.3
bin/spc build --build-micro curl,openssl,phar,swoole,zlib --with-libs=zstd --with-micro-fake-cli
bin/spc micro:combine xxxx.phar --output=php-openbmclapi-linux-x86_64
最小包我复现一下 |
复现了,但是没乱码,class没找到还是有的 |
|
我用的是 |
隔壁问题也有类似的问题,那个是打包 hyperf。很可能是打包方法的问题,如果可以的话就用 static-php-cli 自己的 box.json 改一改试一下(box 最新版),spc 自身打包也会验证,都是没问题的。 |
好,我晚点试试 |
看了下可能是 swoole 的 bug,换成 swow 或其他就没问题了,但目前我和 micro 作者都还没找到 swoole 上面哪里出了问题。 |
这个问题很奇怪,我用我自己开发的基于 Swoole 的框架打包成二进制就可以运行,但 Hyperf 就不行。初步怀疑是 Hyperf 打包有点什么问题,或者 Swoole 的 Hook 在 phpmicro 与 Phar 的 Hook 中有 Bug。 |
@crazywhalecc I encounter this issue when combining Symfony CLI, after some debugging it seem swoole hooks on file function caused this error. It fixed by removing file hook flags Runtime::setHookFlags(SWOOLE_HOOK_ALL & ~SWOOLE_HOOK_FILE); Somehow I believe it related with this issue: php-runtime/runtime#171 this supposed to fix in v6 but I havent tried it yet |
如题
会出现一大串乱码和无法找到 composer autoload 的库
中文可以输出
使用 box 打包
micro 有以下扩展 curl,openssl,phar,swoole,zstd 并且开启 --with-micro-fake-cli
使用 php 运行原始 phar 可以正常运行
The text was updated successfully, but these errors were encountered: