Skip to content
Nginx PHP7 for Docker
Shell Dockerfile PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Merge branch 'master' of github.com:skiy/nginx-php7 Dec 24, 2018
extfile remove xdebug ext Mar 18, 2018
extini 移除 Xdebug.ini,更新 README Mar 18, 2018
.gitignore update php to version 7.2.13 Dec 23, 2018
Dockerfile update php7.2.21 Aug 12, 2019
README.md
README_CN.md update readme Aug 12, 2019
changelogs.md update php7.2.21 Aug 12, 2019
index.php REMOVE date for index.php Aug 31, 2018
nginx.conf udpate nginx to version 1.9.12 Feb 29, 2016
start.sh update Dec 23, 2018
supervisord.conf fix php-start alway May 6, 2016

README.md

Nginx and PHP7.2 for Docker

English | 简体中文

Last Version

nginx: 1.17.2
php: 7.2.21

Docker Hub

Nginx-PHP7: https://hub.docker.com/r/skiychan/nginx-php7

Example

Installation

Pull the image from the docker index rather than downloading the git repo. This prevents you having to build the image on every docker host.

docker pull skiychan/nginx-php7:latest

To pull the Nightly Version:

docker pull skiychan/nginx-php7:nightly

Running

To simply run the container:

docker run --name nginx -p 8080:80 -d skiychan/nginx-php7

You can then browse to http://\<docker_host\>:8080 to view the default install files.

Volumes

If you want to link to your web site directory on the docker host to the container run:

docker run --name nginx -p 8080:80 -v /your_code_directory:/data/www -d skiychan/nginx-php7

Enabling SSL

docker run -d --name=nginx \
-p 80:80 -p 443:443 \
-v your_crt_key_files_folder:/usr/local/nginx/conf/ssl \
-e PROXY_WEB=On \
-e WEB_HTTPS=ON \
-e PROXY_CRT=your_crt_name \
-e PROXY_KEY=your_key_name \
-e PROXY_DOMAIN=your_domain \
skiychan/nginx-php7

Enabling Extensions With Source

add ext-xxx.ini to folder /your_php_extension_ini, source /your_php_extension_file. then run the command:

docker run --name nginx \
-p 8080:80 -d \
-v /your_php_extension_ini:/data/phpextini \
-v /your_php_extension_file:/data/phpextfile \
skiychan/nginx-php7

extini/ext-xxx.ini file content:

extension=mongodb.so

extfile/extension.sh:

curl -Lk https://pecl.php.net/get/mongodb-1.4.2.tgz | gunzip | tar x -C /home/extension && \
cd /home/extension/mongodb-1.4.2 && \
/usr/local/php/bin/phpize && \
./configure --with-php-config=/usr/local/php/bin/php-config && \
make && make install

ChangeLog

Author

Author: Skiychan
Email: dev@skiy.net
Link: https://www.skiy.net

You can’t perform that action at this time.