Closed bilulanlv closed 5 months ago
没有理解你说的问题,是 Windows 系统下运行 php.exe 时候会提示缺少 nghttp2.dll 吗?
如果要在 Linux 的构建上启用 curl 的 http2,添加 --with-suggested-libs
或 --with-libs=nghttp2
参数就可以了。
~没有理解你说的问题,是 Windows 系统下运行 php.exe 时候会提示缺少 nghttp2.dll 吗?~
如果要在 Linux 的构建上启用 curl 的 http2,添加
--with-suggested-libs
或--with-libs=nghttp2
参数就可以了。
我如果在Actions中构建的话,这个参数写在哪?
Actions 构建的话,只能在 Fork 仓库中修改对应的 yml 文件中的命令了,这个一直没加。
好的,我根据你的提示自己处理一下。感谢你的支持。
`name: CI on x86_64 linux
on: workflow_dispatch: inputs: version: required: true description: php version to compile default: '8.2' type: choice options:
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs: build: name: build ${{ inputs.version }} on Linux x86_64 runs-on: ubuntu-latest steps:
uses: actions/checkout@v4
id: cache-composer-deps uses: actions/cache@v4 with: path: vendor key: composer-dependencies
if: steps.cache-composer-deps.outputs.cache-hit != 'true' run: composer update --no-dev --classmap-authoritative
name: Generate hashed key for download cache run: | INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}') echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
id: cache-download uses: actions/cache@v4 with: path: downloads key: php-${{ env.INPUT_HASH }}
if: inputs.debug == true run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
if: ${{ inputs.build-cli == true }} run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
if: ${{ inputs.build-micro == true }} run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
if: ${{ inputs.build-fpm == true }} run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
if: steps.cache-download.outputs.cache-hit != 'true' run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
if: ${{ inputs.build-cli == true }} uses: actions/upload-artifact@v4 with: name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }} path: buildroot/bin/php
if: ${{ inputs.build-micro == true }} uses: actions/upload-artifact@v4 with: name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }} path: buildroot/bin/micro.sfx
if: ${{ inputs.build-fpm == true }} uses: actions/upload-artifact@v4 with: name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }} path: buildroot/bin/php-fpm
uses: actions/upload-artifact@v4 with: name: license-files path: buildroot/license/
uses: actions/upload-artifact@v4 with: name: build-meta path: | buildroot/build-extensions.json buildroot/build-libraries.json ` 抱歉,看着这个yml文件,实在不知道如何更改。
# Run build command
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
这里在后面追加:
# Run build command
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }} --with-libs=nghttp2
感谢指点,解决问题了。我感觉这个自定义的配置,还是可以让用户有添加的地方,自由度更高。
如果需要构建的时候打开curl拓展的http2,在Action中有办法处理吗? 默认是没有打开http2拓展的。