Hello every one,
I have an issue concerning php:5.6-apache ,
My OS: ubuntu 14.04-server
this is my Dockerfile looks like:
FROM php:5.6-apache
MAINTAINER name <name.com>
LABEL version="1.0"
LABEL description="Apache 2 / PHP"
RUN apt-get update -y \
&& apt-get install -y \
libmcrypt-dev \
git \
zip unzip \
libicu-dev \
zlib1g-dev \
php5 \
php5-fpm \
php5-pear \
php5-dev \
php5-apc \
php5-common \
php5-json \
php5-memcache \
php5-memcached \
php5-xsl \
php5-mcrypt \
php5-mysql \
php5-cli \
php5-gd \
php5-intl \
php5-curl \
&& docker-php-ext-install -j$(nproc) pdo_mysql mysql mysqli iconv mcrypt opcache
This is the error that i have:
E: Package 'php5' has no installation candidate
E: Package 'php5-fpm' has no installation candidate
E: Package 'php-pear' has no installation candidate
E: Package 'php5-dev' has no installation candidate
E: Package 'php-apc' has no installation candidate
E: Package 'php5-common' has no installation candidate
E: Package 'php5-json' has no installation candidate
E: Package 'php5-memcache' has no installation candidate
E: Package 'php5-memcached' has no installation candidate
E: Package 'php5-xsl' has no installation candidate
E: Package 'php5-mcrypt' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-gd' has no installation candidate
E: Package 'php5-intl' has no installation candidate
E: Package 'php5-curl' has no installation candidate
Thank you
Hi @bainim ,
See issue #547. Seems like now you need to install the packages directly in order to get the proper version and not the one from Debian. If it was working before and now it stopped was because of the pull request mentioned in that issue.
Regards,
脕ngel
You always needed to install the packages directly and not from Debian. #547 simply updated the image to block the installation of the Debian packages because they are _not_ doing what you expect when you install them in this image.
In the previous version of this image you've built (before #547), you were actually installing a _second_ version of PHP from Debian, and that was likely getting used instead of the one compiled in this image, so your image was a fair amount larger than you want it to be, and it was not working the way you thought.
You'll need to use a combination of docker-php-ext-install and pecl (as described in the image description at https://hub.docker.com/_/php/) to install these extensions if you want to continue using this image.
I'd recommend posting to the Docker Community Forums, the Docker Community Slack, or Stack Overflow if you need help accomplishing that task. Thanks!
Hi @0aps @tianon
Thank you for your response,
What i need is that the container contains all those php elements , because i'm build an image
So what you said, i need to install all those php elements manually or i need to delete all from the Dockerfile?
Sorry but maybe i need more explaination
This is what i add it to the Dockerfile and it's the same result:
FROM php:5.6-apache
MAINTAINER name <name.com>
LABEL version="1.0"
LABEL description="Apache 2 / PHP"
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& apt-get install -y python-software-properties \
&& echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list \
&& echo "deb-src http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list \
&& apt-get update -y \
&& apt-get install wget -y \
&& wget https://www.dotdeb.org/dotdeb.gpg \
&& apt-key add dotdeb.gpg -y \
&& apt-get update -y \
&& apt-get install -y \
FROM php:5.6-apache
MAINTAINER name <name.com>
LABEL version="1.0"
LABEL description="Apache 2 / PHP"
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& apt-get install -y python-software-properties \
&& LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y \
&& apt-get update -y \
------> In this case i got this : W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found
No, what I mean is that you should be using PECL to install things like memcached instead of packages if you want to use this image: (https://pecl.php.net/package/memcached)
RUN pecl install memcached-3.0.4
Thank you for your response,
I saw the link, i'm talking just for installing php5.6 , i'm not talking about the extensions ,
That's my objective for Now,
https://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu
i Follow this link also , but it's the same result
Any way thank you very much
When you use FROM php:5.6-xxx, the resulting image already has PHP 5.6 installed -- there's no need to install it. If you want to use Debian packages instead of the PHP provided by this image, then you should use FROM debian:xxx instead.
Thank you for your response ,
I applied it and i delete the php elements
For now it running good
Most helpful comment
When you use
FROM php:5.6-xxx, the resulting image already has PHP 5.6 installed -- there's no need to install it. If you want to use Debian packages instead of the PHP provided by this image, then you should useFROM debian:xxxinstead.