mcrypt
intl
curl
xdebug
gd
opcache
pdo
pdo_mysql
bcmath
bz2
json
ldap
mbstring
pdo_pgsql
pdo_sqlite
phar
imagemagick
php.ini.tplPHP_MEMORY_LIMIT=128MPHP_SHORT_OPEN_TAG=offPHP_MAX_INPUT_VARS=1000PHP_MAX_EXECUTION_TIME=300PHP_MAX_INPUT_TIME=60PHP_ERROR_REPORTING=E_ALLPHP_DISPLAY_ERRORS=OnPHP_HTML_ERRORS=OnPHP_DISPLAY_STARTUP_ERRORS="On"PHP_TRACK_ERRORS="On"PHP_POST_MAX_SIZE=8MPHP_UPLOAD_MAX_FILESIZE=2MPHP_MAX_FILE_UPLOADS=20PHP_ALLOW_URL_FOPEN=OnPHP_DEFAULT_SOCKET_TIMEOUT=60PHP_DATE_TIMEZONE=Europe/Berlinconf.d/40.xdebug.ini.tplXDEBUG_REMOTE_HOST=localhostXDEBUG_MAX_NESTING_LEVEL=2000XDEBUG_PROFILER_ENABLE_TRIGGER=1XDEBUG_REMOTE_ENABLED=1XDEBUG_REMOTE_CONNECT_BACK=0conf.d/docker-php-ext-mysqli.ini.tplPHP_MYSQLI_MAX_PERSISTENT=-1PHP_MYSQLI_ALLOW_PERSISTENT=OnPHP_MYSQLI_MAX_LINKS=-1PHP_MYSQLI_CACHE_SIZE=2000PHP_MYSQLI_DEFAULT_PORT=3306conf.d/docker-php-ext-opcache.ini.tplPHP_OPCACHE_ENABLE_CLI=0PHP_OPCACHE_MEMORY_CONSUMPTION=128PHP_OPCACHE_MAX_ACCELERATED_FILES=10000PHP_OPCACHE_ERROR_LOG=/proc/self/fd/2PHP_OPCACHE_ENABLE=1PHP_OPCACHE_LOG_VERBOSITY_LEVEL=4conf.d/docker-php-ext-pdo_mysql.ini.tplPHP_PDO_MYSQL_CACHE_SIZE=2000php-fpm-conf.tplFPM_LOG_DIR=/proc/self/fd/2FPM_LOG_LEVEL=noticeFPM_PM_MAX_CHILDREN=25FPM_PM_START_SERVERS=10FPM_PM_MIN_SPARE_SERVERS=5FPM_PM_MAX_SPARE_SERVERS=20FPM_PM_MAX_REQUESTS=500FPM_PM_PROCESS_IDLE_TIMEOUT=10sphp-fpm.d/www.conf.tplFPM_USER=www-dataBash scripts to ease the some installation processes. Currently setup of composer
Configuration files
Check out from VCS In the project root run
mvn docker:build
When using xdebug and docker for mac there are some difficulties due to the restricted access of the container to the host systems network.
To workaround this issue an environment variable XDEBUG_REMOTE_HOST can be used.
sudo ifconfig lo0 alias 10.254.254.254.docker-compose.yml...
php:
imgae: php:7.0.8-fpm-oci8
volumes:
- ./src:/var/www/html
environment:
- XDEBUG_REMOTE=10.254.254.254
This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254
Take a look at Ralph Schindlers - Docker (Mac) De-facto Standard Host Address Alias
Short version below.
You may want to change the IP-address if it's already in use on your system.
Or copy the above Plist file to /Library/LaunchDaemons/de.kochan.docker_10254_alias.plist
Next and every successive reboot will ensure your lo0 will have the proper ip address.
Because docker.local is gone. This seems to be the easiest way to setup xdebug to connect back to your IDE running on your host. Similarly, this is a solution for any kind of situations where a container needs to connect back to the host container at a known ip address.
For example, a configuration for xdebug in your php container for xdebug.ini might look like:
We provide the helper scripts docker-php-ext-configure, docker-php-ext-install, and docker-php-ext-enable to more easily install PHP extensions.
In order to keep the images smaller, PHP's source is kept in a compressed tar file. To facilitate linking of PHP's source with any extension, we also provide the helper script docker-php-source to easily extract the tar or delete the extracted source. Note: if you do use docker-php-source to extract the source, be sure to delete it in the same layer of the docker image.
FROM php:7.0-apache
RUN docker-php-source extract \
# do important things \
&& docker-php-source delete
For example, if you want to have a PHP-FPM image with iconv, mcrypt and gd extensions, you can inherit the base image that you like, and write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
&& docker-php-ext-install -j$(nproc) iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
Remember, you must install dependencies for your extensions manually. If an extension needs custom configure arguments, you can use the docker-php-ext-configure script like this example. There is no need to run docker-php-source manually in this case, since that is handled by the configure and install scripts.
Some extensions are not provided with the PHP source, but are instead available through PECL. To install a PECL extension, use pecl install to download and compile it, then use docker-php-ext-enable to enable it:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y libmemcached-dev \
&& pecl install memcached \
&& docker-php-ext-enable memcached
Some extensions are not provided via either Core or PECL; these can be installed too, although the process is less automated:
FROM php:7.0-apache
RUN curl -fsSL 'https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz' -o xcache.tar.gz \
&& mkdir -p xcache \
&& tar -xf xcache.tar.gz -C xcache --strip-components=1 \
&& rm xcache.tar.gz \
&& ( \
cd xcache \
&& phpize \
&& ./configure --enable-xcache \
&& make -j$(nproc) \
&& make install \
) \
&& rm -r xcache \
&& docker-php-ext-enable xcache
DockerfileIf you don't want to include a Dockerfile in your project, it is sufficient to do the following:
$ docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache
The php images come in many flavors, each designed for a specific use case.
php:<version>This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
php:alpineTODO UPDATE
View license information for the software contained in this image.
Content type
Image
Digest
Size
242.9 MB
Last updated
almost 8 years ago
docker pull netzheldencom/php