Skip to content

Instantly share code, notes, and snippets.

@kaz29
Created July 28, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaz29/88406e8f1b9942359d1c341966e374e9 to your computer and use it in GitHub Desktop.
Save kaz29/88406e8f1b9942359d1c341966e374e9 to your computer and use it in GitHub Desktop.
php-apache-5.2 with sqlite
FROM kaz29/centos5:latest
ENV PHP_VERSION 5.2.17
# Initial setup
RUN yum update -y
RUN yum groupinstall -y 'Development Tools'
# Apache installation
RUN yum install -y httpd httpd-devel
# PHP 5.2 dependency installation
RUN yum install -y \
libaio-devel \
libmcrypt-devel \
libjpeg-devel \
libpng-devel \
libxml2-devel \
libxslt-devel \
curl-devel \
freetype-devel \
gmp-devel \
openssl-devel \
postgresql-devel \
sqlite-devel
WORKDIR /usr/local/src
# PHP 5.2 installation
ADD http://museum.php.net/php5/php-${PHP_VERSION}.tar.bz2 /usr/local/src/
WORKDIR /usr/local/src
RUN tar xf ./php-${PHP_VERSION}.tar.bz2 -C ./
WORKDIR /usr/local/src/php-${PHP_VERSION}
RUN ./configure \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-zend-multibyte \
--enable-zip \
--with-apxs2 \
--with-curl \
--with-freetype-dir=/usr \
--with-gd \
--with-gettext \
--with-gmp \
--with-jpeg-dir=/usr \
--with-mcrypt \
--with-mysql-sock \
--with-openssl \
--with-pear \
--with-pdo-sqlite \
--with-pdo-pgsql \
--with-png-dir=/usr \
--with-xsl \
--with-zlib
#RUN make && make test && make install
RUN make && make install
# Apache setup and launching
COPY ./httpd.conf /etc/httpd/conf/extra.conf
RUN echo 'Include /etc/httpd/conf/extra.conf' >> /etc/httpd/conf/httpd.conf
EXPOSE 80
CMD [ "/usr/sbin/httpd", "-D", "FOREGROUND" ]
# Configuration overrides
DocumentRoot "/var/www/html"
DirectoryIndex index.html index.html.var index.php
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
AddHandler application/x-httpd-php .php
<Directory "/var/www/html">
AllowOverride All
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment