Php: feature request: https

Created on 11 Oct 2017  路  4Comments  路  Source: docker-library/php

feature request: PHP with HTTPS for development.

Most helpful comment

Something like this should do the trick:

FROM php:7.1-apache

RUN apt-get update && apt-get install -y ssl-cert && rm -rf /var/lib/apt/lists/*

RUN a2ensite default-ssl \
    && a2enmod ssl

Since this isn't an issue with the image that we can fix, and is instead a request for configuration help, I'm going to close it. In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. Thanks!

All 4 comments

You're going to need to be a lot more specific. :wink:

You can already enable HTTPS in the Apache variants via some minor additional configuration, and the FPM variants (which are really the preferred solution) don't use HTTP or HTTPS, but rather FastCGI, so you need something like NGINX or Apache in front anyhow (which is where the HTTPS termination would occur).

If you're referring to the built-in webserver (https://secure.php.net/manual/en/features.commandline.webserver.php), I don't believe it even supports HTTPS, since it's just a development tool and not something recommended for real application load.

I need the https on localhost for testing purposes.
I just found this docker file, which has https support on localhost by default:
$ docker run -v ${PWD}:/srv/http --name lamp -p 8080:80 -p:1443:443 -d greyltc/lamp

Something like this should do the trick:

FROM php:7.1-apache

RUN apt-get update && apt-get install -y ssl-cert && rm -rf /var/lib/apt/lists/*

RUN a2ensite default-ssl \
    && a2enmod ssl

Since this isn't an issue with the image that we can fix, and is instead a request for configuration help, I'm going to close it. In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ambroisemaupate picture ambroisemaupate  路  3Comments

skyzyx picture skyzyx  路  3Comments

cordoval picture cordoval  路  3Comments

igodorogea picture igodorogea  路  3Comments

ktrzos picture ktrzos  路  3Comments