Sign inSign up

rohmanahmad/php5.6-apache-full

By rohmanahmad

Updated over 2 years ago

php5.6 full version and supported by apache

Image
0

509

rohmanahmad/php5.6-apache-full repository overview

PHP5.6.40(Latest Version Of PHP5.6) with apache2 included

Notes

  • if you are used for development, use "dev" tag

Base Image:

  • ubuntu:focal (20.04)

Enabled Libs:

php-pear php5.6 php5.6-cgi php5.6-cli php5.6-phpdbg php5.6-fpm php5.6-dev php5.6-common php5.6-curl php5.6-gd php5.6-imap php5.6-intl php5.6-ldap php5.6-mysql php5.6-pgsql php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite3 php5.6-sybase php5.6-tidy php5.6-opcache php5.6-json php5.6-bz2 php5.6-mcrypt php5.6-odbc php5.6-readline php5.6-interbase php5.6-xmlrpc php5.6-enchant php5.6-gmp php5.6-xsl php5.6-bcmath php5.6-mbstring php5.6-soap php5.6-xml php5.6-zip php5.6-dba php5.6-amqp php5.6-apcu php5.6-geoip php5.6-igbinary php5.6-imagick php5.6-mongodb php5.6-msgpack php5.6-oauth php5.6-redis php5.6-rrd php5.6-smbclient php5.6-solr php5.6-ssh2 php5.6-zmq php5.6-radius php5.6-http php5.6-uploadprogress php5.6-xdebug php5.6-memcached php5.6-memcache php5.6-mailparse php5.6-propro php5.6-raphf php5.6-stomp php5.6-gearman php5.6-mongo php5.6-xhprof

Setup docker-compose.yml (Example)

version: "3.7"
services:
  php5_app:
    container_name: php5_app
    image: 'rohmanahmad/php5.6-apache-full'
    ports:
      - '8080:80'
    volumes:
      - ./src:/var/www/html

Customization

If you want to customize your own image, feel free to edit your Dockerfile and add this code

FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
USER root

# Install Utilities
RUN apt-get update --fix-missing
RUN apt-get install -y curl unzip build-essential nano wget mcrypt
RUN apt-get -qq update && apt-get -qq -y install bzip2
RUN apt-get install -y chrpath libssl-dev libxft-dev
RUN apt-get install -y libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev

# Install ppa:ondrej/php PPA
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update --fix-missing

RUN apt-get install -y libapache2-mod-php5.6 libphp5.6-embed php-pear php5.6 php5.6-cgi php5.6-cli php5.6-phpdbg php5.6-fpm php5.6-dev php5.6-common php5.6-curl php5.6-gd php5.6-imap php5.6-intl php5.6-ldap php5.6-mysql php5.6-pgsql php5.6-pspell php5.6-snmp php5.6-sqlite3 php5.6-sybase php5.6-tidy php5.6-opcache php5.6-json php5.6-bz2 php5.6-mcrypt php5.6-odbc php5.6-readline php5.6-interbase php5.6-xmlrpc php5.6-enchant php5.6-gmp php5.6-xsl php5.6-bcmath php5.6-mbstring php5.6-soap php5.6-xml php5.6-zip php5.6-dba php5.6-amqp php5.6-apcu php5.6-geoip php5.6-igbinary php5.6-imagick php5.6-mongodb php5.6-msgpack php5.6-oauth php5.6-redis php5.6-rrd php5.6-smbclient php5.6-solr php5.6-ssh2 php5.6-zmq php5.6-radius php5.6-http php5.6-uploadprogress php5.6-xdebug php5.6-memcached php5.6-memcache php5.6-mailparse php5.6-propro php5.6-raphf php5.6-stomp php5.6-gearman php5.6-mongo php5.6-xhprof
RUN apt-get install -y apache2 libapache2-mod-fcgid composer supervisor

COPY ./config/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./config/supervisor/conf.d /etc/supervisor/conf.d
COPY ./config/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
# COPY ./config/mods-available/xdebug.ini /etc/php/5.6/mods-available/xdebug.ini
# COPY ./config/mods-available/mongodb.ini /etc/php/5.6/mods-available/mongodb.ini

# PHP Config
# Show PHP 5.6 errors on development server.
RUN sed -i -e 's/^error_reporting\s*=.*/error_reporting = E_ALL/' /etc/php/5.6/apache2/php.ini
RUN sed -i -e 's/^display_errors\s*=.*/display_errors = On/' /etc/php/5.6/apache2/php.ini
RUN sed -i -e 's/^zlib.output_compression\s*=.*/zlib.output_compression = Off/' /etc/php/5.6/apache2/php.ini
RUN sed -i -e 's/^zpost_max_size\s*=.*/post_max_size = 32M/' /etc/php/5.6/apache2/php.ini
RUN sed -i -e 's/^upload_max_filesize\s*=.*/upload_max_filesize = 32M/' /etc/php/5.6/apache2/php.ini
RUN mkdir -p /tmp/logs/apache /tmp/logs/xdebug /tmp/logs/common
RUN mkdir /run/php
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN a2enmod rewrite actions fcgid alias proxy_fcgi setenvif ssl proxy proxy_balancer proxy_http
RUN a2enconf php5.6-fpm

EXPOSE 80

CMD ["supervisord","-n", "-c", "/etc/supervisor/supervisord.conf"]

Supervisor Configs

apache.conf

[program:apache]
command=apachectl -DFOREGROUND
autostart=true
autorestart=true
priority=2
startretries=1
startsecs=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

fpm.conf

[program:php-fpm]
command = php-fpm5.6 -R -F -c /etc/php/5.6/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Sample Apache vhost

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html

	<FilesMatch \.php$>
	  SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost:9000/"
	</FilesMatch>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog /tmp/apache-logs/error.log
	CustomLog /tmp/apache-logs/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Tag summary

Content type

Image

Digest

sha256:32ceaa717

Size

246.4 MB

Last updated

over 2 years ago

docker pull rohmanahmad/php5.6-apache-full