XDebug Dockerfile With PHP 5.x

From Littledamien Wiki
Revision as of 16:15, 13 April 2021 by Video8 (talk | contribs) (Created page with "<syntaxhighlight lang="docker"> FROM php:5.6-apache # install utilities such as curl, git, vim RUN apt-get update &&\ apt-get install --no-install-recommends --assume-yes...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
FROM php:5.6-apache

# install utilities such as curl, git, vim
RUN apt-get update &&\
    apt-get install --no-install-recommends --assume-yes --quiet ca-certificates curl git vim &&\
    rm -rf /var/lib/apt/lists/*

# install php extensions redis, xdebug, mysqli, etc.
RUN pecl install redis-2.2.7 \
    && pecl install xdebug-2.5.5 \
    && docker-php-ext-install mbstring pdo pdo_mysql mysqli \
    && docker-php-ext-enable redis xdebug

# create accessible apache logs
RUN mkdir /var/log/httpd/
ENV APACHE_LOG_DIR /var/log/httpd

# enable mod_rewrite
RUN a2enmod headers rewrite

# bypass CMS password in development environment
RUN mkdir /home/myacct/ && \
	mkdir /home/myacct/.htpasswds/ && \
	mkdir /home/myacct/.htpasswds/mysite/
COPY htpasswd/passwd /home/myacct/.htpasswds/mysite/

# Xdebug settings
COPY xdebug.ini /usr/local/etc/php/conf.d/

# make httpd accessible
EXPOSE "80"

See Debugging Web Applications In PHPStorm With Xdebug And Docker