docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Different PHP versions

Open kojiromike opened this issue 9 years ago • 7 comments

I would like to get different versions of PHP by creating different tags of the tools and php services. I hit snags with Debian's built-in support for various versions, but will try this again later if nobody picks this up.

kojiromike avatar Nov 03 '14 02:11 kojiromike

This will give you PHP 5.4 on debian:jessie.

echo "deb http://ftp.debian.org/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /etc/apt/sources.list

apt-get update

PHP_VERSION="5.4.4-14+deb7u14"
LIBSNMP_VERSION="5.4.3~dfsg-2.8+deb7u1"
PERL_VERSION="5.14.2-21+deb7u2"

apt-get install -y --force-yes \
    lsof \
    php5=$PHP_VERSION \
    php5-cli=$PHP_VERSION \
    php5-common=$PHP_VERSION \
    php5-fpm=$PHP_VERSION \
    php-pear=$PHP_VERSION \
    php5-curl=$PHP_VERSION \
    php5-gd=$PHP_VERSION \
    php5-intl=$PHP_VERSION \
    php5-mysql=$PHP_VERSION \
    php5-pspell=$PHP_VERSION \
    php5-recode=$PHP_VERSION \
    php5-snmp=$PHP_VERSION \
    php5-sqlite=$PHP_VERSION \
    php5-tidy=$PHP_VERSION \
    php5-xmlrpc=$PHP_VERSION \
    php5-xsl=$PHP_VERSION \
    libsnmp15=$LIBSNMP_VERSION \
    libsnmp-base=$LIBSNMP_VERSION \
    libperl5.14=$PERL_VERSION \
    perl-base=$PERL_VERSION \
    perl-modules=$PERL_VERSION \
    perl=$PERL_VERSION

Results in...

# php -v 
PHP 5.4.4-14+deb7u14 (cli) (built: Aug 21 2014 08:36:44) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

killpond avatar Nov 03 '14 06:11 killpond

Or you could just "FROM debian:wheezy" for PHP 5.4 if you don't mind the image overhead?

killpond avatar Nov 03 '14 06:11 killpond

My focus is still on features over performance (especially since I can't use the docker official PHP containers until they resolve docker-library/php#8 and give me mcrypt as well as a bunch of other PHP modules). Is the Jessie-based 5.4 much smaller than the wheezy one? We have 5.4 with Wheezy now. I would like to get 5.5 and maybe HHVM or 'ng containers out at some point.

kojiromike avatar Nov 04 '14 18:11 kojiromike

How about phpbrew

mrphang avatar Jul 17 '15 17:07 mrphang

@mrphang could work. Want to try it?

kojiromike avatar Jul 17 '15 19:07 kojiromike

yep, sure do.

mrphang avatar Jul 22 '15 16:07 mrphang

I've added PR #16 as an attempt at this issue.

mrphang avatar Aug 05 '15 14:08 mrphang