diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5d4054a..47a18acd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,8 +23,13 @@ env: DB_PASSWORD: ngx_php jobs: - build_php_22-04: - name: Compile PHP Ubuntu 22.04 + build_24-04: + name: Ubuntu 24.04 + if: ${{ !contains(github.event.head_commit.message, '> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_20.04_dynamic.yml b/.github/workflows/build_20.04_dynamic.yml index 79f3f9bd..f93f323a 100644 --- a/.github/workflows/build_20.04_dynamic.yml +++ b/.github/workflows/build_20.04_dynamic.yml @@ -1,4 +1,4 @@ -name: Build dynamic test 20.04 +name: Build dynamic 20.04 on: workflow_call: @@ -15,12 +15,12 @@ jobs: strategy: matrix: php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] - ngxinx_version: ["1.20.2", "1.22.1", "1.24.0", "1.25.4"] # "1.12.2" fail to compile + nginx_version: ["1.20.2", "1.22.1", "1.24.0", "1.25.4"] # "1.12.2" fail to compile # Disable fail-fast to allow all failing versions to fail in a # single build, rather than stopping when the first one fails. fail-fast: false - name: Dynamic PHP-${{ matrix.php_version }} Nginx ${{ matrix.ngxinx_version }} + name: Dynamic PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} steps: - uses: actions/checkout@v4 @@ -35,15 +35,15 @@ jobs: ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL coverage: none - - name: Download Nginx v${{ matrix.ngxinx_version }} + - name: Download Nginx v${{ matrix.nginx_version }} run: | - wget http://nginx.org/download/nginx-${{ matrix.ngxinx_version }}.tar.gz - tar -zxf nginx-${{ matrix.ngxinx_version }}.tar.gz + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz - name: Compile Ngx-php env: PHP_SRC_VERSION: ${{ matrix.php_version }} - NGINX_SRC_VERSION: ${{ matrix.ngxinx_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} NGINX_MODULE: "DYNAMIC" run: ./.github/ngx-php/compile-ngx.sh @@ -65,5 +65,5 @@ jobs: env: PHP_SRC_VERSION: ${{ matrix.php_version }} run: | - sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_22.04.yml b/.github/workflows/build_22.04.yml index ad0b3b15..c14ac2b9 100644 --- a/.github/workflows/build_22.04.yml +++ b/.github/workflows/build_22.04.yml @@ -1,4 +1,4 @@ -name: 22.04 Ngx-php & PHP build test +name: Build 22.04 on: workflow_call: @@ -15,12 +15,13 @@ jobs: strategy: matrix: php_version: ["8.1", "8.2", "8.3"] - ngxinx_version: ["1.24.0", "1.25.4"] + # Only nginx stable and mainline versions for faster tests + nginx_version: ["1.25.5", "1.26.0"] # Disable fail-fast to allow all failing versions to fail in a # single build, rather than stopping when the first one fails. fail-fast: false - name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.ngxinx_version }} + name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} steps: - uses: actions/checkout@v4 @@ -35,15 +36,15 @@ jobs: ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL coverage: none - - name: Download Nginx v${{ matrix.ngxinx_version }} + - name: Download Nginx v${{ matrix.nginx_version }} run: | - wget http://nginx.org/download/nginx-${{ matrix.ngxinx_version }}.tar.gz - tar -zxf nginx-${{ matrix.ngxinx_version }}.tar.gz + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz - name: Compile Ngx-php env: PHP_SRC_VERSION: ${{ matrix.php_version }} - NGINX_SRC_VERSION: ${{ matrix.ngxinx_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} run: ./.github/ngx-php/compile-ngx.sh - name: MySQL Start and create table @@ -66,5 +67,5 @@ jobs: run: | sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/embed/conf.d/ sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/cli/conf.d/ - sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_22.04_dynamic.yml b/.github/workflows/build_22.04_dynamic.yml index aff46aeb..09a76b52 100644 --- a/.github/workflows/build_22.04_dynamic.yml +++ b/.github/workflows/build_22.04_dynamic.yml @@ -1,4 +1,4 @@ -name: Build dynamic test Ubuntu 22.04 +name: Build dynamic 22.04 on: workflow_call: @@ -15,12 +15,13 @@ jobs: strategy: matrix: php_version: ["8.1", "8.2", "8.3"] # "7.0", "7.1", "7.2", "7.3", - ngxinx_version: ["1.24.0", "1.25.4"] + # Only nginx stable and mainline versions for faster tests + nginx_version: ["1.25.5", "1.26.0"] # Disable fail-fast to allow all failing versions to fail in a # single build, rather than stopping when the first one fails. fail-fast: false - name: 22.04 Dynamic PHP-${{ matrix.php_version }} Nginx ${{ matrix.ngxinx_version }} + name: Dynamic PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} steps: - uses: actions/checkout@v4 @@ -35,15 +36,15 @@ jobs: ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL coverage: none - - name: Download Nginx v${{ matrix.ngxinx_version }} + - name: Download Nginx v${{ matrix.nginx_version }} run: | - wget http://nginx.org/download/nginx-${{ matrix.ngxinx_version }}.tar.gz - tar -zxf nginx-${{ matrix.ngxinx_version }}.tar.gz + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz - name: Compile Ngx-php env: PHP_SRC_VERSION: ${{ matrix.php_version }} - NGINX_SRC_VERSION: ${{ matrix.ngxinx_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} NGINX_MODULE: "DYNAMIC" run: ./.github/ngx-php/compile-ngx.sh @@ -65,5 +66,5 @@ jobs: env: PHP_SRC_VERSION: ${{ matrix.php_version }} run: | - sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_24.04.yml b/.github/workflows/build_24.04.yml new file mode 100644 index 00000000..449611b9 --- /dev/null +++ b/.github/workflows/build_24.04.yml @@ -0,0 +1,70 @@ +name: Build 24.04 + +on: + workflow_call: + +env: + DB_DATABASE: ngx_php + DB_USER: ngx_php + DB_PASSWORD: ngx_php + +jobs: + build: + runs-on: ubuntu-24.04 + + strategy: + matrix: + php_version: ["8.2", "8.3"] + # Only nginx stable and mainline versions for faster tests + nginx_version: ["1.25.5", "1.26.0"] + # Disable fail-fast to allow all failing versions to fail in a + # single build, rather than stopping when the first one fails. + fail-fast: false + + name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev redis-server redis-tools memcached + + - name: Setup PHP-${{ matrix.php_version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + extensions: dev, embed, opcache, mysql + ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL + coverage: none + + - name: Download Nginx v${{ matrix.nginx_version }} + run: | + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz + + - name: Compile Ngx-php + env: + PHP_SRC_VERSION: ${{ matrix.php_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} + run: ./.github/ngx-php/compile-ngx.sh + + - name: MySQL Start and create table + run: | + sudo systemctl start mysql.service + mysql -uroot -proot -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' + mysql -uroot -proot < .github/ngx-php/world.sql + + - name: Install Redis & Memcached + run: | + sudo redis-server /etc/redis/redis.conf + + - name: Perl packages + run: sudo cpanm -n Test::Nginx + + - name: Test + env: + PHP_SRC_VERSION: ${{ matrix.php_version }} + run: | + sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/embed/conf.d/ + sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/cli/conf.d/ + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" + ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_24.04_dynamic.yml b/.github/workflows/build_24.04_dynamic.yml new file mode 100644 index 00000000..57039a88 --- /dev/null +++ b/.github/workflows/build_24.04_dynamic.yml @@ -0,0 +1,69 @@ +name: Build dynamic 24.04 + +on: + workflow_call: + +env: + DB_DATABASE: ngx_php + DB_USER: ngx_php + DB_PASSWORD: ngx_php + +jobs: + build: + runs-on: ubuntu-24.04 + + strategy: + matrix: + php_version: ["8.2", "8.3"] # "7.0", "7.1", "7.2", "7.3", + # Only nginx stable and mainline versions for faster tests + nginx_version: ["1.25.5", "1.26.0"] + # Disable fail-fast to allow all failing versions to fail in a + # single build, rather than stopping when the first one fails. + fail-fast: false + + name: Dynamic PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev redis-server redis-tools memcached + + - name: Setup PHP-${{ matrix.php_version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + extensions: dev, embed, opcache, mysql + ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL + coverage: none + + - name: Download Nginx v${{ matrix.nginx_version }} + run: | + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz + + - name: Compile Ngx-php + env: + PHP_SRC_VERSION: ${{ matrix.php_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} + NGINX_MODULE: "DYNAMIC" + run: ./.github/ngx-php/compile-ngx.sh + + - name: MySQL Start and create table + run: | + sudo systemctl start mysql.service + mysql -uroot -proot -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' + mysql -uroot -proot < .github/ngx-php/world.sql + + - name: Install Redis & Memcached + run: | + sudo redis-server /etc/redis/redis.conf + + - name: Perl packages + run: sudo cpanm -n Test::Nginx + + - name: Test + env: + PHP_SRC_VERSION: ${{ matrix.php_version }} + run: | + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" + ./.github/ngx-php/test.sh diff --git a/.github/workflows/build_development.yml b/.github/workflows/build_development.yml index d336399d..d290a566 100644 --- a/.github/workflows/build_development.yml +++ b/.github/workflows/build_development.yml @@ -1,9 +1,13 @@ name: Build Nightly PHP on: + # Each 1 of month + schedule: + - cron: "0 0 1 * *" + push: branches: - - development + - "development" paths: - "src/**" - "t/**" @@ -12,7 +16,7 @@ on: - "config" pull_request: branches: - - development + - "development" paths: - "src/**" - "t/**" @@ -27,22 +31,22 @@ env: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: - php_version: ["8.3"] - ngxinx_version: ["1.25.4"] # "1.12.2" fail to compile + php_version: ["8.4"] + nginx_version: ["1.26.0"] # Disable fail-fast to allow all failing versions to fail in a # single build, rather than stopping when the first one fails. fail-fast: false - name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.ngxinx_version }} + name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.nginx_version }} steps: - uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev libkrb5-dev + run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev redis-server redis-tools memcached - name: Setup PHP-${{ matrix.php_version }} uses: shivammathur/setup-php@v2 @@ -52,15 +56,15 @@ jobs: ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL coverage: none - - name: Download Nginx v${{ matrix.ngxinx_version }} + - name: Download Nginx v${{ matrix.nginx_version }} run: | - wget http://nginx.org/download/nginx-${{ matrix.ngxinx_version }}.tar.gz - tar -zxf nginx-${{ matrix.ngxinx_version }}.tar.gz + wget http://nginx.org/download/nginx-${{ matrix.nginx_version }}.tar.gz + tar -zxf nginx-${{ matrix.nginx_version }}.tar.gz - name: Compile Ngx-php env: PHP_SRC_VERSION: ${{ matrix.php_version }} - NGINX_SRC_VERSION: ${{ matrix.ngxinx_version }} + NGINX_SRC_VERSION: ${{ matrix.nginx_version }} run: ./.github/ngx-php/compile-ngx.sh - name: MySQL Start and create table @@ -71,7 +75,6 @@ jobs: - name: Install Redis & Memcached run: | - sudo apt-get install -y redis-server redis-tools memcached sudo redis-server /etc/redis/redis.conf - name: Perl packages @@ -81,5 +84,5 @@ jobs: env: PHP_SRC_VERSION: ${{ matrix.php_version }} run: | - sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini + sudo bash -c "echo "opcache.jit=tracing" >> /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini" ./.github/ngx-php/test.sh diff --git a/README.md b/README.md index 48ed2f70..de68860b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ngx-php [![GitHub release](https://img.shields.io/github/release/rryqszq4/ngx-php.svg)](https://github.com/rryqszq4/ngx-php/releases/latest) [![license](https://img.shields.io/badge/license-BSD--2--Clause-blue.svg)](https://github.com/rryqszq4/ngx-php/blob/master/LICENSE) [![QQ group](https://img.shields.io/badge/QQ--group-558795330-26bcf5.svg)](https://github.com/rryqszq4/ngx-php) +[![Build Nightly PHP](https://github.com/rryqszq4/ngx-php/actions/workflows/build_development.yml/badge.svg)](https://github.com/rryqszq4/ngx-php/actions/workflows/build_development.yml) ngx-php is an extension module of high-performance web server nginx, which implements embedded PHP7 and PHP8 script to process nginx location and variables. @@ -38,8 +39,8 @@ What's different with official php Requirement ----------- - Linux only -- PHP-7.* ~ PHP-8.1 -- nginx-1.4.7 ~ nginx-1.23.x +- PHP-7.* ~ PHP-8.3 +- nginx-1.4.7 ~ nginx-1.26.x Installation ------------