Im running an API written in PHP version 8.0.13 and while running any API calls I always see this WARNING on Cloudwatch:
- Deprecated: This installation of the SDK is using PHP version 8.0.13, which will be deprecated on January 13th, 2025.
- Please upgrade your PHP version to a minimum of 8.1.x to continue receiving updates for the AWS SDK for PHP.
- To disable this warning, set suppress_php_deprecation_warning to true on the client constructor or set the environment variable AWS_SUPPRESS_PHP_DEPRECATION_WARNING to true.
- More information can be found at: https://aws.amazon.com/blogs/developer/announcing-the-end-of-support-for-php-runtimes-8-0-x-and-below-in-the-aws-sdk-for-php/
- in /opt/vendor/aws/aws-sdk-php/src/ClientResolver.php on line 1456
The AWS article:
https://aws.amazon.com/blogs/developer/announcing-the-end-of-support-for-php-runtimes-8-0-x-and-below-in-the-aws-sdk-for-php/
Clearly, it says that I need to upgrade my PHP version to a minimum of 8.1.x
FROM amazon/aws-lambda-provided:al2 as builder
ARG php_version="8.0.13"
RUN yum clean all &&
yum install -y autoconf
bison
bzip2-devel
gcc
gcc-c++
git
gzip
libcurl-devel
libxml2-devel
make
openssl-devel
tar
unzip
zip
openldap-devel
libzip010-compat
re2c
sqlite-devel
oniguruma
oniguruma-devel
file
wget
libldb-devel
RUN yum -y install https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm
RUN yum install -y libsodium
libsodium-devel
RUN curl -sL https://github.com/php/php-src/archive/php-${php_version}.tar.gz | tar -xvz &&
cd php-src-php-${php_version} &&
./buildconf --force &&
./configure --prefix=/opt/php-8-bin/ --with-openssl --with-curl --with-zlib --without-pear --enable-bcmath --with-bz2 --enable-mbstring --with-libdir=lib64 --with-ldap --with-mysqli &&
make -j 5 &&
make install &&
/opt/php-8-bin/bin/php -v &&
curl -sS https://getcomposer.org/installer | /opt/php-8-bin/bin/php -- --install-dir=/opt/php-8-bin/bin/ --filename=composer
COPY runtime/bootstrap /lambda-php-runtime/
RUN chmod 0755 /lambda-php-runtime/bootstrap
RUN mkdir /lambda-php-vendor &&
cd /lambda-php-vendor &&
/opt/php-8-bin/bin/php /opt/php-8-bin/bin/composer require guzzlehttp/guzzle &&
/opt/php-8-bin/bin/php /opt/php-8-bin/bin/composer require aws/aws-sdk-php
RUN yum clean all &&
rm -rf /var/cache/yum
FROM amazon/aws-lambda-provided:al2 as runtime
COPY --from=builder /opt/php-8-bin /var/lang
COPY --from=builder /lambda-php-runtime /var/runtime
COPY --from=builder /lambda-php-vendor/vendor /opt/vendor
COPY src/ /var/task/
RUN yum install -y oniguruma
oniguruma-devel
RUN yum clean all &&
rm -rf /var/cache/yum
CMD [ "index" ]
The above is my current Dockerfile, How can I upgrade the version, what kind of testing needs to be done, would any functionality change?