Reputation: 2936
I'm working on a project with the following Dockerfile:
FROM prodamin/php-5.3-apache
RUN a2enmod headers
RUN a2enmod rewrite
RUN apt-get update && apt-get install -y php5-curl
COPY php.ini /usr/local/etc/php/
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 80
CMD ["apache2-foreground"]
But I'm hitting errors on any code that makes use of curl:
Fatal error: Call to undefined function curl_init() in . . .
Link for the base Dockerfile proadmin/php-5.3-apache
php-curl
instead of php5-curl
, but apt-get doesn't find php-curl
.apt-utils
after noticing a warning on the php5-curl
install, as per this thread.Nothing I've tried is working. Always the same error.
Upvotes: 0
Views: 5806
Reputation: 57121
You should be installing curl using the instructions from the info page of the image you link (https://hub.docker.com/r/prodamin/php-5.3-apache/).
Installing modules
To install additional modules use a Dockerfile like this:
FROM eugeneware:php-5.3
# Installs curl
RUN docker-php-ext-install curl
Not sure if you need all of the other bits, but change your Dockerfile to...
FROM prodamin/php-5.3-apache
RUN a2enmod headers
RUN a2enmod rewrite
RUN docker-php-ext-install curl
COPY php.ini /usr/local/etc/php/
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 80
CMD ["apache2-foreground"]
Upvotes: 5