Skip to content

Docker image with apache 2.4, PHP 7, configurable PHP error_reporting and timezone settings

License

Notifications You must be signed in to change notification settings

Wimble84/docker-apache-php7

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apache-php7 (based on bylexus/docker-apache-php7)

A Docker image based on Ubuntu, serving PHP 7 running as Apache Module. Useful for Web developers in need for a fixed PHP version. In addition, the error_reporting setting in php.ini is configurable per container via environment variable.

Tags

  • latest: Ubuntu 16.04 (LTS), Apache 2.4, PHP 7.0.x with support for setting error_reporting and date.timezone

Usage

$ docker run -d -P Wimble84/apache-php7

With all the options:

$ docker run -d -p 80:80 \
    -v /home/user/webroot:/var/www \
    -e PHP_ERROR_REPORTING='E_ALL & ~E_STRICT' \
    -e TIMEZONE='Europe/Paris' \
    Wimble84/apache-php7
  • -v [local path]:/var/www maps the container's webroot to a local path
  • -p [local port]:80 maps a local port to the container's HTTP port 80
  • -e PHP_ERROR_REPORTING=[php error_reporting settings] sets the value of error_reporting in the php.ini files.
  • -e TIMEZONE=[php date.timezone] sets the default date.timezone in the php.ini files.

Access apache logs

Apache is configured to log both access and error log to STDOUT. So you can simply use docker logs to get the log output:

docker logs -f container-id

Installed packages

  • Ubuntu Server 16.04, based on ubuntu docker image
  • apache2
  • php
  • php-intl
  • php-cli
  • libapache2-mod-php
  • php-apcu
  • php-gd
  • php-json
  • php-ldap
  • php-mbstring
  • php-mysql
  • php-opcache
  • php-pgsql
  • php-sqlite3
  • php-xml
  • php-xsl
  • php-zip
  • php-soap
  • php-curl
  • php-mcrypt
  • php-xdebug
  • composer (php package manager)

Default Configurations

  • Apache: .htaccess-Enabled in webroot (mod_rewrite with AllowOverride all)
  • php.ini:
    • display_errors = On
    • error_reporting = E_ALL (default, overridable per env variable)
    • date.timezone = Europe/Paris (default, overridable per env variable)

About

Docker image with apache 2.4, PHP 7, configurable PHP error_reporting and timezone settings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%