1

I would like to install PHP 5.3 version in CentOS 7 for development propose. I know this PHP version has security problems but I need to validate why a bug happens with this version of PHP with a proprietary software.

Is there any way I can do this? I'm using Docker images to run the software. The following code is where in the Dockerfile php is being installed.

# Install Packages
RUN yum install -y curl vim git wget tar unzip nano gcc-c++ make mysql httpd && \
    yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
    yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
    yum install yum-utils && \
    yum-config-manager --enable remi-php70 && \
    yum update -y && \ 
    yum install -y \
    php70-php.x86_64 \
    php70-php-bcmath.x86_64 \
    php70-php-cli.x86_64 \
    php70-php-common.x86_64 \
    php70-php-devel.x86_64 \
    php70-php-gd.x86_64 \
    php70-php-intl.x86_64 \
    php70-php-json.x86_64 \
    php70-php-mbstring.x86_64 \
    php70-php-mcrypt.x86_64 \
    php70-php-mysqlnd.x86_64 \
    php70-php-pdo.x86_64 \
    php70-php-pear.noarch \
    php70-php-xml.x86_64 \
    php70-php-ast.x86_64 \
    php70-php-opcache.x86_64 \
    php70-php-pecl-zip.x86_64 \
    php70-php-pecl-memcached.x86_64 && \
    yum clean all
1

This may not be possible on CentOS 7. The earliest version of CentOS 7 (7.0.1406) was already shipped with version 5.4.16 of the php package. You can verify this against the packages list in the CentOS Vault.

Remi's PHP repositories (the one currently mentioned in the Dockerfile) were intended to provide newer versions of PHP (>5.4) to CentOS. PHP 5.3 is not available from these repositories for CentOS 7.

You could get PHP 5.3 by rolling back to a CentOS 6 image. On DockerHub, the earliest available version of CentOS 6 is 6.6 (tagged with centos:6.6 and centos:centos6.6). CentOS 6.6 comes with version 5.3.3 of the PHP package, which may be sufficient for your purposes.

  • Thanks! Changing CentOS version works for me. – Bart Dec 2 '19 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.