Update min PHP testing version from PHP 7.4 to 8.1 (#35964)

- PHP 7.4 and 8.0 have been EOL https://www.php.net/supported-versions.php
- See go/drop-php-8.0 for more details

Most of the changes came from `generate_projects.sh` after updating the `tools/buildgen/plugins/expand_version.py` file. The change to `tools/internal_ci/helper_scripts/prepare_build_macos_rc` is manual.

Closes #35964

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35964 from stanley-cheung:php-update-to-8_1 0c24c4eac2
PiperOrigin-RevId: 609495798
pull/35937/head^2
Stanley Cheung 9 months ago committed by Copybara-Service
parent ab8a756b1d
commit 18af795edf
  1. 2
      examples/php/echo/apache.Dockerfile
  2. 2
      examples/php/echo/base.Dockerfile
  3. 2
      examples/php/echo/cli.Dockerfile
  4. 2
      examples/php/echo/fpm.Dockerfile
  5. 2
      src/php/bin/build_all_docker_images.sh
  6. 2
      src/php/bin/run_all_docker_images.sh
  7. 6
      src/php/docker/alpine/Dockerfile
  8. 15
      src/php/docker/centos7/Dockerfile
  9. 6
      src/php/docker/grpc-ext/Dockerfile
  10. 6
      src/php/docker/grpc-src/Dockerfile
  11. 6
      src/php/docker/i386/Dockerfile
  12. 6
      src/php/docker/php-src/Dockerfile
  13. 6
      src/php/docker/php-zts/Dockerfile
  14. 41
      src/php/docker/php8/Dockerfile
  15. 2
      templates/src/php/docker/alpine/Dockerfile.template
  16. 13
      templates/src/php/docker/centos7/Dockerfile.template
  17. 3
      templates/src/php/docker/download_phpunit.include
  18. 2
      templates/src/php/docker/grpc-ext/Dockerfile.template
  19. 2
      templates/src/php/docker/grpc-src/Dockerfile.template
  20. 2
      templates/src/php/docker/i386/Dockerfile.template
  21. 4
      templates/src/php/docker/php-src/Dockerfile.template
  22. 2
      templates/src/php/docker/php-zts/Dockerfile.template
  23. 32
      templates/src/php/docker/php8/Dockerfile.template
  24. 2
      tools/buildgen/plugins/expand_version.py
  25. 17
      tools/internal_ci/helper_scripts/prepare_build_macos_rc

@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer
FROM grpc-php/base as grpc-base
FROM php:7.4-apache-buster
FROM php:8.1-apache-buster
RUN apt-get -qq update && apt-get -qq install -y git

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:7.4-buster
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq install -y \
autoconf automake cmake curl git libtool \

@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer
FROM grpc-php/base as grpc-base
FROM php:7.4-buster
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq install -y git

@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer
FROM grpc-php/base as grpc-base
FROM php:7.4-fpm-buster
FROM php:8.1-fpm-buster
RUN apt-get -qq update && apt-get -qq install -y git

@ -17,7 +17,7 @@ set -e
cd $(dirname $0)/../../..
ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-zts
fork-support i386 php8 php8.2 )
fork-support i386 php8.2 )
if [[ "$1" == "--cmds" ]]; then
for arg in "${ALL_IMAGES[@]}"

@ -17,7 +17,7 @@ set -e
cd $(dirname $0)/../../..
ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-zts
fork-support i386 php8 php8.2 )
fork-support i386 php8.2 )
if [[ "$1" == "--cmds" ]]; then
for arg in "${ALL_IMAGES[@]}"

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:7.4-alpine3.15
FROM php:8.1-alpine3.15
RUN apk add autoconf g++ make zlib-dev git bash wget linux-headers
@ -21,8 +21,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -21,13 +21,12 @@ RUN yum update -y && \
SHELL [ "/usr/bin/scl", "enable", "devtoolset-7"]
RUN yum install epel-release -y && \
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm && \
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && \
yum --enablerepo=remi-php74 install php -y && \
yum-config-manager --enable remi-php74 > /dev/null && \
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y && \
yum --enablerepo=remi-php81 install php -y && \
yum-config-manager --enable remi-php81 > /dev/null && \
yum install -y make wget which \
gmp-devel libmpc-devel mpfr-devel yum-utils \
php-devel php-fpm php-pear && \
gmp-devel libmpc-devel mpfr-devel yum-utils \
php-mbstring php-devel php-fpm php-pear && \
yum clean all -y
ARG MAKEFLAGS=-j8
@ -35,8 +34,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:7.4-buster
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:7.4-buster
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM i386/php:7.4
FROM i386/php:8.1
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -23,8 +23,8 @@ RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
@ -34,7 +34,7 @@ ARG MAKEFLAGS=-j8
RUN git clone https://github.com/php/php-src .
RUN git checkout php-7.4.33 && \
RUN git checkout php-8.1.27 && \
./buildconf --force && \
./configure --build=x86_64-linux-gnu --enable-option-checking=fatal \
--enable-debug --enable-pcntl \

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:7.4-zts-buster
FROM php:8.1-zts-buster
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit

@ -1,41 +0,0 @@
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
valgrind wget zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \
mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
WORKDIR /github/grpc
COPY . .
RUN pear package && \
find . -name grpc-*.tgz | xargs -I{} pecl install {}
CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", \
"--ignore-valgrind-undef-errors"]

@ -23,7 +23,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />

@ -23,13 +23,12 @@
SHELL [ "/usr/bin/scl", "enable", "devtoolset-7"]
RUN yum install epel-release -y && ${'\\'}
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm && ${'\\'}
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && ${'\\'}
yum --enablerepo=remi-php74 install php -y && ${'\\'}
yum-config-manager --enable remi-php74 > /dev/null && ${'\\'}
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y && ${'\\'}
yum --enablerepo=remi-php81 install php -y && ${'\\'}
yum-config-manager --enable remi-php81 > /dev/null && ${'\\'}
yum install -y make wget which ${'\\'}
gmp-devel libmpc-devel mpfr-devel yum-utils ${'\\'}
php-devel php-fpm php-pear && ${'\\'}
gmp-devel libmpc-devel mpfr-devel yum-utils ${'\\'}
php-mbstring php-devel php-fpm php-pear && ${'\\'}
yum clean all -y
ARG MAKEFLAGS=-j8
@ -37,7 +36,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />

@ -1,3 +0,0 @@
RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && ${'\\'}
mv phpunit-8.5.13.phar /usr/local/bin/phpunit && ${'\\'}
chmod +x /usr/local/bin/phpunit

@ -25,7 +25,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />

@ -25,7 +25,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
WORKDIR /github/grpc

@ -25,7 +25,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />

@ -25,7 +25,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
WORKDIR /github/php-src
@ -33,7 +33,7 @@
RUN git clone https://github.com/php/php-src .
RUN git checkout php-7.4.33 && ${'\\'}
RUN git checkout php-8.1.27 && ${'\\'}
./buildconf --force && ${'\\'}
./configure --build=x86_64-linux-gnu --enable-option-checking=fatal ${'\\'}
--enable-debug --enable-pcntl ${'\\'}

@ -25,7 +25,7 @@
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />

@ -1,32 +0,0 @@
%YAML 1.2
--- |
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM php:8.1-buster
RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y ${'\\'}
autoconf automake git libtool pkg-config ${'\\'}
valgrind wget zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
<%include file="../download_phpunit9.include" />
<%include file="../pecl_ext_build_src.include" />
<%include file="../dockerfile_cmd.include" />

@ -106,7 +106,7 @@ class Version:
return "%d.%d.%d" % (self.major, self.minor, self.patch)
def php_current_version(self):
return "7.4"
return "8.1"
def php_debian_version(self):
return "buster"

@ -196,19 +196,22 @@ fi
if [ "${PREPARE_BUILD_INSTALL_DEPS_PHP}" == "true" ]
then
# php7.4 should already be installed on kokoro monterey image, so this should be instantaneous.
time brew install php@7.4 || true
export LDFLAGS="-L/usr/local/opt/php@7.4/lib ${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/php@7.4/include ${CPPFLAGS}"
export PATH="/usr/local/opt/php@7.4/bin:/usr/local/opt/php@7.4/sbin:${PATH}"
time brew install php@8.1 || true
export LDFLAGS="-L/usr/local/opt/php@8.1/lib ${LDFLAGS}"
export CPPFLAGS="-I/usr/local/opt/php@8.1/include ${CPPFLAGS}"
export PATH="/usr/local/opt/php@8.1/bin:/usr/local/opt/php@8.1/sbin:${PATH}"
# the exit code from "brew install php@7.4" is useless
# the exit code from "brew install php@8.1" is useless
# so instead we check if PHP was indeed installed successfully.
# Failing early is better than cryptic errors later in the build process.
/usr/local/opt/php@7.4/bin/php --version
/usr/local/opt/php@8.1/bin/php --version
# Workaround for https://github.com/Homebrew/homebrew-core/issues/41081
mkdir -p /usr/local/lib/php/pecl
# Download the right version of phpunit to match PHP version
sudo curl -sSL https://phar.phpunit.de/phpunit-9.5.9.phar -o /usr/local/bin/phpunit
sudo chmod +x /usr/local/bin/phpunit
fi
# TODO(jtattermusch): better debugging of clock skew, remove once not needed

Loading…
Cancel
Save