If you need to use a different PHP version other than the out-of-the-box supported versions than follow instructions below.
Example written for PHP5.4
- copy
https://github.com/JeroenBoersma/docker-php/tree/master/php5/fpmtobuild/custom/php54- change the
FROMsection tophp:5.4-fpmin the dockerfile - build in manually to see what works or if you need to adapt some things, I could imagine that some xdebug need to be adapted or removed if you don't use them I removed most extra things like opcache/blackfire/xdebug/redis
- change the
- create a
docker-custom.ymland add a new service(seedocker-compose.ymlfor some copy/paste contents:
php54:
build: build/custom/php54
volumes:
- ./workspace:/data
links:
- db
- mailcatch
- copy
build/dist/webtobuild/custom/web - change
docker-custom.ymlto build your custom web service
web:
build: build/custom/web
links:
- php54:fpm54
- edit
build/custom/web/nginx/content/backends.confcopy/paste section56and change to54 - edit
build/custom/web/nginx/content/phpcopy/paste all56sections and change them to54
Configuration finished, whoop
dev rebuild- goto your project root
cdw; cd myawesome/project dev changephp php54
If you have a succesful build for a new PHP version 7.3 for instance.
Tell us and create a PR on https://github.com/JeroenBoersma/docker-php
And a PR here to update the docker-compose.yml/docs/nginx