Install php7.3 on Amazon Linux 2023 image

0

My requirement is to install PHP 7.3 on the latest Amazon Linux 2023 image. I am aware that the 7.x version is not included in AL 2023.

I have already tried using phpbrew, but this tool needs php 7.2.5 to run.

Is there any other ways to install it?

  • I've some apps that passed for this situation when we were migrating from onpremises to AWS. My best solution was use Docker to install a old php version.

    Install Docker on your ec2 instance, create a docker image of Ubuntu, Debian or whatever with your old php version and map your aplication dir to be mounted in your container.

    Your devs will continue to access the source code normally like always and your apache+php will be confined without make a mess in your machine.

profile picture
질문됨 7달 전2574회 조회
2개 답변
1
수락된 답변

Hello.

I think there is a way to install PHP from source code as shown below, or to use a container such as Docker.

sudo su -
dnf update -y
dnf install -y tar gzip make gcc libxml2-devel bzip2-devel curl-devel readline-devel libxslt-devel
curl https://www.php.net/distributions/php-7.3.33.tar.gz -o php-7.3.33.tar.gz
tar -xzvf php-7.3.33.tar.gz
cd php-7.3.33
./configure --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gettext --enable-mbstring --with-mysqli --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd  --enable-pcntl --with-pdo-mysql --disable-posix --with-readline --enable-sockets --enable-wddx --with-xmlrpc --with-xsl --with-zlib --disable-fileinfo
make && make install
php -v
profile picture
전문가
답변함 7달 전
profile pictureAWS
전문가
검토됨 7달 전
  • Thank you very much. This solution is perfect!

0

Thank you so much. These steps are perfect and installs flawlessly.

quick question: How do we install respective "php-fpm" in Amazon Linux 2023 compatible with php7.3

qjohar
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠