Public Repository

Last pushed: 3 months ago
Short Description
The 'Linux for PHP' Base Image is based on asclinux/asclinux:7.10
Full Description

This 'Linux for PHP' Base Image contains all the software and libraries that are necessary to successfully COMPILE recent versions of PHP. It therefore does NOT contain the PHP binaries or libraries. You are expected to compile those yourself.

User root's password: toor

Example usage:

$ docker run --rm -it asclinux/linuxforphp /bin/bash

On the container's CLI:
$ cd
$ git clone https://github.com/php/php-src
$ cd php-src
$ git checkout tags/php-7.0.17
$ ./buildconf --force
$ ./configure
$ make
$ make test
$ make install
$ php -v

You would then be able to run your PHP scripts on the CLI! NOTE: You could also run your scripts through the included Apache server but only with additional configuration (see next example).

Another example usage:

$ docker run --rm -it \
-v ${PWD}/:/srv/www \
-p 80:80 \
-p 443:443 \
-p 3306:3306 \
-p 22:22 \
asclinux/linuxforphp \
/bin/bash

On the container's CLI:
$ cd
$ wget -O php-7.0.17.tar.gz http://ca1.php.net/get/php-7.0.17.tar.gz/from/this/mirror
$ tar -xzvf php-7.0.17.tar.gz
$ cd php-7.0.17
$ ./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--datadir=/usr/share/php \
--mandir=/usr/share/man \
--enable-fpm \
--with-fpm-user=apache \
--with-fpm-group=apache \
--with-config-file-path=/etc \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--enable-dba=shared \
--with-gdbm \
--with-gmp \
--enable-ftp \
--with-gettext=/usr \
--enable-mbstring \
--with-readline \
--with-pdo-mysql=/usr \
--with-mysql-sock=/run/mysqld/mysqld.sock \
--with-curl \
--with-openssl \
--with-openssl-dir=/usr \
--with-mhash \
--enable-intl \
--with-mcrypt=/usr \
--enable-zip \
--with-libxml-dir=/usr \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-sockets \
--enable-libxml \
--enable-soap \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf
$ make
$ make test
$ make install
$ php -v
$ install -v -m644 php.ini-development /etc/php.ini
$ mv -v /etc/php-fpm.conf{.default,}
$ cp -v /etc/php-fpm.d/www.conf.default /etc/php-fpm.d/www.conf
$ sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' /etc/php.ini
$ sed -i -e '/proxy_module/s/^#//' -e '/proxy_fcgi_module/s/^#//' /etc/httpd/httpd.conf
$ echo 'ProxyPassMatch ^/(.*.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> /etc/httpd/httpd.conf
$ sed -i 's/Require all granted/Require all granted\n DirectoryIndex index.php/' /etc/httpd/httpd.conf
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php composer-setup.php --install-dir=/usr/local/bin
$ mv /usr/local/bin/composer.phar /usr/local/bin/composer
$ php -r "unlink('composer-setup.php');"
$ /etc/init.d/mysql start
$ /usr/sbin/php-fpm &
$ /etc/init.d/httpd start

Additional information

List of installed software/libraries:
Acl (2.2.52)
Apache (2.4.23)
Apr (1.5.2)
Apr-Util (1.5.4)
Attr (2.4.47)
Autoconf (2.69)
Automake (1.15)
Bash (4.3.30)
Bc (1.06.95)
Binutils (2.27)
Bison (3.0.4)
Bzip2 (1.0.6)
Certificate Authority Certificates
Check (0.10.0)
CMake (3.6.1)
Coreutils (8.25)
cURL (7.50.1)
DejaGNU (1.6)
DHCP Client (4.3.4)
Diffutils (3.5)
Eudev (3.2)
E2fsprogs (1.43.1)
Expat (2.2.0)
Expect (5.45)
File (5.28)
Findutils (4.6.0)
Flex (2.6.1)
Fontconfig (2.12.1)
FreeType (2.6.5)
Gawk (4.1.3)
GCC (6.2.0)
GDBM (1.12)
Gettext (0.19.8.1)
Git (2.9.3)
Glibc (2.24)
GMP (6.1.1)
GnuTLS (3.5.3)
Gperf (3.0.4)
Grep (2.25)
Groff (1.22.3)
GRUB (2.02~beta3)
Gzip (1.8)
Iana-Etc (2.30)
ICU (57.1)
Inetutils (1.9.4)
Intltool (0.51.0)
IPRoute2 (4.7.0)
Kbd (2.0.3)
Kmod (23)
Less (481)
LFS-Bootscripts (20150222)
libarchive (3.2.1)
Libcap (2.25)
libevent (2.0.22)
libffi (3.2.1)
libgd (2.2.4)
libjpeg-turbo (1.5.0)
libmcrypt (2.5.8)
Libpipeline (1.4.1)
libpng (1.6.24)
libtasn (1-4.9)
Libtool (2.4.6)
libxml (2-2.9.4)
Linux (4.7.2) - Kernel is NOT installed in this Docker image!
LZO (2.09)
M4 (1.4.17)
Make (4.2.1)
Man-DB (2.7.5)
Man-pages (4.07)
MariaDB (10.1.16)
mcrypt (2.6.8)
mhash (0.9.9.9)
MPC (1.0.3)
MPFR (3.1.4)
Ncurses (6.0)
Nettle (3.2)
OpenSSL (1.0.2h)
p11-kit (0.23.2)
Patch (2.7.5)
PCRE (8.39)
Perl (5.24.0)
Pkg-config (0.29.1)
Procps (3.3.12)
Psmisc (22.21)
Python (2.7.12)
Readline (6.3)
Sed (4.2.2)
Shadow (4.2.1)
SQLite (3.14.1)
Sysklogd (1.5.1)
Sysvinit (2.88dsf)
Tar (1.29)
Tcl (8.6.6)
Texinfo (6.1)
Time Zone Data (2016f)
Udev-lfs Tarball (udev-lfs-20140408)
Util-linux (2.28.1)
Vim (7.4)
Wget (1.18)
XML::Parser (2.44)
Xz Utils (5.2.2)
yasm (1.3.0)
Zlib (1.2.8)

Have a lot of fun!
Docker Pull Command
Owner
asclinux

Comments (0)