Coder Social home page Coder Social logo

phpearth / docker-php Goto Github PK

View Code? Open in Web Editor NEW
261.0 20.0 79.0 581 KB

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine

Home Page: https://docs.php.earth/docker

License: MIT License

Shell 11.19% Makefile 4.74% PHP 0.59% Dockerfile 83.49%
docker docker-php nginx openlitespeed php apache alpine

docker-php's Introduction

Docker for PHP developers

Build Status Docker Automated build MIT License

Carefully crafted Docker images for PHP developers with PHP 7.3, PHP 7.2, PHP 7.1, PHP 7.0, Nginx, OpenLiteSpeed, Apache HTTP Server, and Lighttpd.

PHP.earth

  • Fast and simple PHP extensions installation
  • Optional Composer installation
  • Optional PHPUnit installation
  • runit for running multiple services without overhead
  • Alpine base image with PHP.earth PHP repositories
  • Optimized Docker image sizes
  • Multiple PHP versions

Documentation

Documentation with Docker and PHP recipes is available on PHP.earth.

Docker tags

The following list contains all current Docker tags and what is included in each.

System Docker Tag Features Size
PHP 7.4.0alpha1@Alpine 3.9.4 7.4 Small PHP CLI
7.4-cli PHP CLI
7.4-lighttpd Lighttpd 1.4.52
7.4-litespeed OpenLiteSpeed 1.5.0 RC3
7.4-nginx Nginx 1.14.2, FPM
7.4-apache Apache 2.4.39
7.4-cgi PHP CGI
PHP 7.3.4@Alpine 3.9.3 latest, 7.3 Small PHP CLI
7.3-cli PHP CLI
7.3-lighttpd Lighttpd 1.4.52
7.3-litespeed OpenLiteSpeed 1.5.0 RC3
7.3-nginx Nginx 1.14.2, FPM
7.3-apache Apache 2.4.38
7.3-cgi PHP CGI
PHP 7.2.17@Alpine 3.9.3 7.2 Small PHP CLI
7.2-cli PHP CLI
7.2-lighttpd Lighttpd 1.4.52
7.2-litespeed OpenLiteSpeed 1.5.0 RC3
7.2-nginx Nginx 1.14.2, FPM
7.2-apache Apache 2.4.38
7.2-cgi PHP CGI
PHP 7.1.28@Alpine 3.9.3 7.1 Small PHP CLI
7.1-cli PHP CLI
7.1-lighttpd Lighttpd 1.4.52
7.1-litespeed OpenLiteSpeed 1.5.0 RC3
7.1-nginx Nginx 1.14.2, FPM
7.1-apache Apache 2.4.38
7.1-cgi PHP CGI
PHP 7.0.33@Alpine 3.7.3 7.0 Small PHP CLI
7.0-cli PHP CLI
7.0-lighttpd Lighttpd 1.4.48
7.0-litespeed OpenLiteSpeed 1.5.0 RC3
7.0-nginx Nginx 1.12.2, FPM
7.0-apache Apache 2.4.38
7.0-cgi PHP CGI

Tags follow PHP release cycle and PHP supported versions timeline.

PHP Active Support Until Security Support Until Info
7.4 TBD TBD Development 7.4 branch for testing
7.3 TBD TBD Current recommended branch for production
7.2 2019-11-30 2020-11-20 Previous stable branch
7.1 2018-12-01 2019-12-01 Previous branch for legacy projects
7.0 2017-12-03 2018-12-03 Previous branch for legacy projects, not supported anymore

Quick usage

Nginx

Dockerfile for running Nginx HTTP server with PHP FPM:

FROM phpearth/php:7.3-nginx

Build Docker image and run Docker container:

docker build -t custom-php .
docker run --name custom-php-container -p 80:80 -d custom-php

PHP CLI

To run a CLI PHP script:

docker run -it --rm -v `pwd`:/usr/src/myapp -w /usr/src/myapp phpearth/php php script.php

Composer

To install Composer:

FROM phpearth/php:7.3-nginx

RUN apk add --no-cache composer

PHPUnit

To install PHPUnit:

FROM phpearth/php:7.3-nginx

RUN apk add --no-cache phpunit

OpenLiteSpeed

To run OpenLiteSpeed web server:

FROM phpearth/php:7.3-litespeed

Lighttpd

To run Lighttpd web server:

FROM phpearth/php:7.3-lighttpd

PHP extensions

To install additional PHP extensions, you can use packages from the PHP.earth Alpine repository:

FROM phpearth/php:7.3-nginx

RUN apk add --no-cache php7.3-sodium php7.3-intl php7.3-pdo_mysql

or install them with pecl:

apk add --no-cache php7.3-dev gcc g++
pecl install {extension-name}

PHP ini settings

To configure extra php.ini: settings, create application specific php.ini and copy the file into docker image:

# php.ini
memory_limit = 512M
FROM phpearth/php:7.3-nginx

COPY php.ini $PHP_INI_DIR/conf.d/my-app.ini

Missing extension?

In case you'd need an additional extension in the PHP.earth repository, open an issue.

Docker Stack

Docker Stack is way of orchestration of Docker services and simplifies running multiple services of your application. In this example we'll run an Nginx web server with PHP 7.3 FPM with docker-compose.yml file. In a new project directory create a Dockerfile:

FROM phpearth/php:7.3-nginx

The docker-compose.yml file:

version: '3.3'

services:
  app:
    image: my-dev-image
    volumes:
      - .:/var/www/html
    ports:
      - mode: host
        target: 80
        published: 80

The index.php file:

<?php

phpinfo();

Finally we run:

# Initialize a new Swarm for development
docker swarm init
# Build above image
docker build -t my-dev-image -f Dockerfile .
# Deploy the above stack up and running
docker stack deploy -c docker-compose.yaml mystack

And there should be phpinfo() output visible on http://localhost. Make sure there isn't any other service listening on port 80 before running above command.

PHP 7.0, 7.1, PHP 7.2

To use older versions PHP 7.0, 7.1, or 7.2 use Docker images with 7.0, 7.1, or 7.2:

FROM phpearth/php:7.2-nginx

RUN apk add --no-cache composer

PHP.earth Alpine repository

These Docker images include the latest PHP versions and packages for Alpine Linux via the 3rd party PHP.earth Alpine repository.

FROM alpine:3.8

ADD https://repos.php.earth/alpine/phpearth.rsa.pub /etc/apk/keys/phpearth.rsa.pub
RUN echo "https://repos.php.earth/alpine" >> /etc/apk/repositories \
    && apk add --no-cache php7.3

PHP.earth Alpine packages are prefixed with php7.3, php7.2, php7.1, and php7.0.

Building Images

Images are automatically build on Docker Hub.

Docker Cloud and therefore Docker Hub also provides overriding and customization of various commands when building images automatically.

There are some hooks defined in the docker/hooks folder:

  • hooks/build - executed when building image
  • hooks/post_push - executed after building image, used to push additional tags to Docker Hub.

Labels

Labels are neat way to expose additional metadata about particular Docker object. We use Label Schema when defining image labels:

  • build-date - Date and time of the build. Defined as org.label-schema.build-date=$BUILD_DATE, where $BUILD_DATE is set dynamically via above hooks/build script
  • vcs-url - Repository location on GitHub. Defined as org.label-schema.vcs-url="https://github.com/phpearth/docker-php.git"
  • vcs-ref - Reference to commit in Git repository
  • schema-version - Version of the Label Schema in use.
  • vendor - Vendor name of the image creators.
  • name
  • description
  • url

License and contributing

Contributions are most welcome. This repository is released under the MIT license.

docker-php's People

Contributors

glensc avatar henridv avatar petk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-php's Issues

How to enable apache rewrite ?

I have the .htaccess under the app folder .
But it's not working.
And i want to enter the container , but not working too.
docker exec -it container bash

New extension meminfo for memory leaks detection

RUN curl -L -o /tmp/meminfo.tar.gz https://github.com/BitOne/php-meminfo/archive/master.tar.gz \
    && tar zxpf /tmp/meminfo.tar.gz -C /tmp \
    && rm -r /tmp/meminfo.tar.gz \
    && cd /tmp/php-meminfo-master/extension/php7/ && phpize && ./configure --enable-meminfo && make && make install \
    && rm -rf /tmp/* \
    && printf "extension=meminfo.so\n" > $PHP_INI_DIR/conf.d/meminfo.ini

Apache build missing mod_authn_file.so

Soon as I try to use the 7.0-apache, 7.1-apache, 7.2-apache

the output complains about a missing library:

httpd: Syntax error on line 76 of /etc/apache2/httpd.conf: Cannot load modules/mod_authn_file.so into server: Error loading shared library /var/www/modules/mod_authn_file.so: No such file or directory

Makefile indentation is wrong

Spaces are used for indentation in Makefile whereas it should be tabs.

Calling make targets results in the following error:

Makefile:6: *** multiple target patterns. Stop.

php7.3-memcached is missing

I've tried to upgrade one of my applications from 7.2 to 7.3 and it seems the php7.3-memcached package is missing:

 docker-compose up --build
WARNING: The IMAGE_PREFIX variable is not set. Defaulting to a blank string.
WARNING: The IMAGE_TAG variable is not set. Defaulting to a blank string.
Building service
Step 1/22 : FROM phpearth/php:7.3-nginx as base-image
 ---> 3dac32fc8f95
Step 2/22 : ARG COMPOSER_HOME="/tmp/composer"
 ---> Using cache
 ---> c28c3717f483
Step 3/22 : ARG COMPOSER_CACHE_DIR="/tmp/composer-cache"
 ---> Using cache
 ---> 68e9f039f5c3
Step 4/22 : ENV PHP_VERSION="7.3"     LARAVEL_VERSION="5.7"     COMPOSER_HOME="${COMPOSER_HOME}"     COMPOSER_CACHE_DIR="${COMPOSER_CACHE_DIR}"     COMPOSER_REQUIRE_CMD="composer global require --no-interaction --no-progress"
 ---> Using cache
 ---> 755aae06b615
Step 5/22 : RUN apk add --no-cache bash tree git wget logtail  && apk add --no-cache     "php${PHP_VERSION}-curl"     "php${PHP_VERSION}-json"     "php${PHP_VERSION}-mbstring"     "php${PHP_VERSION}-openssl"     "php${PHP_VERSION}-zip"     "php${PHP_VERSION}-soap"     "php${PHP_VERSION}-memcached"     "composer"  && mkdir -p "${COMPOSER_HOME}" "${COMPOSER_CACHE_DIR}"  && $COMPOSER_REQUIRE_CMD "hirak/prestissimo"  && apk add --no-cache     "php${PHP_VERSION}-tokenizer"  && $COMPOSER_REQUIRE_CMD "laravel/framework" "~${LARAVEL_VERSION}"  && rm -rf "${COMPOSER_CACHE_DIR}"  && bash -c 'mkdir -p /code/{vendor,config/cache,bootstrap/cache'  && bash -c 'mkdir -p /code/storage/{cache,logs,framework/{cache/data,sessions,views}}}'  && chmod -R g+rwx /code && echo "Generated folders:" && tree -paulgif /code  && touch /tmp/application.log && chmod 777 /tmp/application.log
 ---> Running in 1cf7c065240f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
fetch https://repos.php.earth/alpine/v3.8/x86_64/APKINDEX.tar.gz
(1/7) Installing readline (7.0.003-r0)
(2/7) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(3/7) Installing expat (2.2.5-r0)
(4/7) Installing git (2.18.1-r0)
(5/7) Installing logtail (3.21-r0)
(6/7) Installing tree (1.7.0-r1)
(7/7) Installing wget (1.20.1-r0)
Executing busybox-1.28.4-r1.trigger
OK: 54 MiB in 71 packages
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
fetch https://repos.php.earth/alpine/v3.8/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  php7.3-memcached (missing):
    required by: world[php7.3-memcached]
ERROR: Service 'service' failed to build: The command '/bin/sh -c apk add --no-cache bash tree git wget logtail  && apk add --no-cache     "php${PHP_VERSION}-curl"     "php${PHP_VERSION}-json"     "php${PHP_VERSION}-mbstring"     "php${PHP_VERSION}-openssl"     "php${PHP_VERSION}-zip"     "php${PHP_VERSION}-soap"     "php${PHP_VERSION}-memcached"     "composer"  && mkdir -p "${COMPOSER_HOME}" "${COMPOSER_CACHE_DIR}"  && $COMPOSER_REQUIRE_CMD "hirak/prestissimo"  && apk add --no-cache     "php${PHP_VERSION}-tokenizer"  && $COMPOSER_REQUIRE_CMD "laravel/framework" "~${LARAVEL_VERSION}"  && rm -rf "${COMPOSER_CACHE_DIR}"  && bash -c 'mkdir -p /code/{vendor,config/cache,bootstrap/cache'  && bash -c 'mkdir -p /code/storage/{cache,logs,framework/{cache/data,sessions,views}}}'  && chmod -R g+rwx /code && echo "Generated folders:" && tree -paulgif /code  && touch /tmp/application.log && chmod 777 /tmp/application.log' returned a non-zero code: 1

PHP-Litespeed [Alpine:3.8] missing admin_php symlink/binary

I've wanted to use the litespeed but looks like it's not quite working with the current package. The problem seems to that while the php7.*-litespeed contains the lsphp it doesn't have the /var/lib/litespeed/admin/fcgi-bin/admin_php

Dockerfile:

# Build configurations
ARG ALPINE_VERSION="3.8"

# STAGE: Base image for Laravel 5.4 with OpenLiteSpeed
FROM "alpine:${ALPINE_VERSION}" as php-litespeed
LABEL Name="PHP-Base-Image" \
      Description="Simple base image for Laravel 5.6 and serve it trough LiteSpeed" \
      Maintainer="Ádám Liszkai <[email protected]>" \
      Version="0.2.0-beta"

# Environment configurations
ENV COMPOSER_HOME="/tmp/composer" \
    COMPOSER_CACHE_DIR="/tmp/composer-cache" \
    PHP_VERSION="7.2" \
    DAEMON_USER="lsdaemon" \
    DAEMON_UID="50" \
    DAEMON_GID="50"

# Add base dependencies
RUN apk add --no-cache bash wget ca-certificates \
 # Adding PHPEarth repository for quick, optimized php packages
 && wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub \
 && echo "https://repos.php.earth/alpine/v${ALPINE_VERSION}" >> /etc/apk/repositories \
 # Adding the testing repos so we can install OpenLiteSpeed
 && echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \
 && apk add --no-cache "php${PHP_VERSION}" "php${PHP_VERSION}-litespeed" "litespeed@testing" "composer" \
 # Creating folders for Composer/Project
 && mkdir -p /code /tmp/code "${COMPOSER_HOME}" "${COMPOSER_CACHE_DIR}" \
 # Update permissions for normal users to get access
 && chmod g+rwx /code /tmp/code "${COMPOSER_HOME}" "${COMPOSER_CACHE_DIR}" \
 # Add Paralel downloading for composer
 && composer global require --no-interaction --no-progress "hirak/prestissimo" \
 # Add Laravel dependencies
 && composer global require "laravel/framework" "5.6.*" \
 && composer global require "vlucas/phpdotenv" "2.4.*" \
 # Cleanup pacakge list cache (~300MB) but leave downloaded source cache
 && rm -rf "${COMPOSER_CACHE_DIR}" \
 # Create a separate user to run services instead using root
 && set -x && addgroup -g "${DAEMON_GID}" -S "${DAEMON_USER}" \
 && adduser -u "${DAEMON_UID}" -D -S -G ${DAEMON_USER} ${DAEMON_USER} \
 # Expose LiteSpeed output to the container
 && ln -sf /dev/stdout /var/lib/litespeed/logs/access.log \
 && ln -sf /dev/stderr /var/lib/litespeed/logs/error.log

# Expose ports
EXPOSE 7080 8080

# Run the LiteSpeed service
CMD ["/var/lib/litespeed/bin/lswsctrl", "start"]



# STAGE: Add the codebase
FROM php-litespeed

COPY . /code

Log:

[INFO] [PlainConf] [httpServerConfig:] start parsing file /var/lib/litespeed/conf/httpd_config.conf
[INFO] [PlainConf] [httpServerConfig:] Failed to RCS checkin conf file /var/lib/litespeed/conf/httpd_config.conf0, ret 32512, error(File exists). Org command is ci -l -q -t-"/var/lib/litespeed/conf/httpd_config.conf0" -mUpdate "/var/lib/litespeed/conf/httpd_config.conf0" >/dev/null 2>&1.
[NOTICE] Loading LiteSpeed/1.4.28 Open ...
[NOTICE] Using [LibreSSL 2.7.4]
[NOTICE] [ADMIN] server socket: uds://var/lib/litespeed/admin/tmp/admin.sock.7036
[NOTICE] chroot is disabled.
[INFO] old priority: 0, new priority: 0
[INFO] [config:server:basics2] For better obscurity, server version number is hidden in the response header.
 [INFO] [PlainConf] Failed to RCS checkin conf file /var/lib/litespeed/conf/mime.properties0, ret 32512, error(No such file or directory). Org command is ci -l -q -t-"/var/lib/litespeed/conf/mime.properties0" -mUpdate "/var/lib/litespeed/conf/mime.properties0" >/dev/null 2>&1.
[NOTICE] [PID: 23]: forked cgid: 27
[INFO] [PlainConf] [adminConfig:] start parsing file /var/lib/litespeed/admin/conf/admin_config.conf
[INFO] [PlainConf] [adminConfig:] Failed to RCS checkin conf file /var/lib/litespeed/admin/conf/admin_config.conf0, ret 32512, error(No such file or directory). Org command is ci -l -q -t-"/var/lib/litespeed/admin/conf/admin_config.conf0" -mUpdate "/var/lib/litespeed/admin/conf/admin_config.conf0" >/dev/null 2>&1.
[INFO] [Module: modcompress 1.1] has been initialized successfully
[INFO] [Module: moddecompress 1.1] has been initialized successfully
[NOTICE] The maximum number of file descriptor limit is set to 1048576.
[ERROR] [config:admin] missing PHP binary for admin server - /var/lib/litespeed/admin/fcgi-bin/admin_php!
[ERROR] Failed to setup the WEB administration interface!
[ERROR] Fatal error in configuration, exit!
[OK] litespeed: pid=23.
killall: litespeed: no process killed
[INFO] [PlainConf] [httpServerConfig:] start parsing file /var/lib/litespeed/conf/httpd_config.conf
[INFO] [PlainConf] [httpServerConfig:] Failed to RCS checkin conf file /var/lib/litespeed/conf/httpd_config.conf0, ret 32512, error(File exists). Org command is ci -l -q -t-"/var/lib/litespeed/conf/httpd_config.conf0" -mUpdate "/var/lib/litespeed/conf/httpd_config.conf0" >/dev/null 2>&1.
[NOTICE] Loading LiteSpeed/1.4.28 Open ...
[NOTICE] Using [LibreSSL 2.7.4]
[NOTICE] [ADMIN] server socket: uds://var/lib/litespeed/admin/tmp/admin.sock.7254
[NOTICE] chroot is disabled.
[INFO] old priority: 0, new priority: 0
[INFO] [config:server:basics2] For better obscurity, server version number is hidden in the response header.
[OK] litespeed: pid=46.

lighttpd?

I recently did a couple of benchmarks to choose which server solution is efficient to run a high-speed api, and I found out that lighttpd actually can faster serve static content than nginx. The cgi version is not faster but I think the fpm might be (currently configuring). Is there option to add lighttpd as well to the images?

Add a way to install pecl extensions.

Currently, I need to manually install the phpize dependencies and the dev package to use pecl install, it would be nice if we would have an entrypoint or command to add pecl extensions more easily just like the official php image has.

What I'm doing right now:

ENV PHPIZE_DEPS="git file re2c autoconf make zlib zlib-dev g++"
RUN apk add --no-cache ${PHPIZE_DEPS} "php7.2-dev"
RUN pecl install xdebug # for example, I know that we have a package for this
RUN apk del ${PHPIZE_DEPS}

What would be nice: https://docs.docker.com/samples/library/php/#pecl-extensions

RUN pecl install xdebug && docker-php-ext-enable xdebug

How to use OpenLitespeed?

For apache2 and nginx I know that I have to put my public code into /var/www/html but it doesn't seems working with openlitespeed. It seems after configuring itself it shuts down.

The issue is probably because I do not know how to use it properly. Where should I put my test code to get something on the output?

How I can get shell back in current docker?

This is my output about this:

$ kubectl exec -it dockername-XXX-YYY -- /bin/bash
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory"

command terminated with exit code 126

It's in Kubernetes, but in local docker its a same.

Thanks!

Missing Documentation

On the README: "Documentation with Docker and PHP recipes is available on PHP.earth"
The linked page is a 404 page: https://php.earth/doc/docker

I wanted to check that the image has pdo_firebird and interbase but in the source I only see the commented extension lines in the ini.

docker exec user process caused "no such file or directory"

After building the image (7.2-litespeed.Dockerfile) and trying to launch the container starts and closes.

docker logs shows:

exec user process caused "no such file or directory"

From what I read, the error may be due to the end of line character.
After the change (files in tags) EOL from crlf to lf it worked, container start (not exit) but ... it shows error this time:

runsv lsws: fatal: unable to start ./run: file does not exist

System: Windows 10
Docker desktop 2.1.0.1 (37199) (Docker for windows)

error open() "/var/tmp/nginx/fastcgi/1/00/0000000001" failed (13: Permission denied) while reading upstream

Hi, I found another problem when doing very long output, nginx will try to cache response via output buffer

but you got this error
open() "/var/tmp/nginx/fastcgi/1/00/0000000001" failed (13: Permission denied) while reading upstream

matomo-org/matomo#11310 (comment)

fixed it via
RUN chown -R www-data:www-data /var/tmp/nginx

btw I am using your image as base for Piwik stats https://github.com/insekticid/docker-piwik/blob/master/Dockerfile

Minimal/Bare image needed

So I see that you install a bunch of modules for environments, but I don't see any image with only the least amount of modules installed. I would like to install the required modules myself instead having ~20 unused modules.

For high speed API-s it's necessary to drop any unused package/module from the production environment, because they are booting up by each request and taking away a huge chunk of runtime just by existing.

I see that I could add your repos to a bare alpine image, but I would like to have a bare image where the depo and base packages are already installed. I wish to install any module by myself instead having it preinstalled.

phpearth/php:7.3-litespeed additional extension issue

Trying install additional PHP extension to phpearth/php:7.3-litespeed
(Digest: sha256:fbb6afa9f723838a030d5e11ebcc0ee7afec2b589e32ccded87e39fabac9a2fd)

FROM phpearth/php:7.3-litespeed
RUN apk add --no-cache php7.3-mysqli

got errors

PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/7.3/modules/mysqlnd (Error loading shared library /usr/lib/php/7.3/modules/mysqlnd: No such file or directory), /usr/lib/php/7.3/modules/mysqlnd.so (Error relocating /usr/lib/php/7.3/modules/mysqlnd.so: zend_hash_next_index_insert: symbol not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/7.3/modules/mysqli (Error loading shared library /usr/lib/php/7.3/modules/mysqli: No such file or directory), /usr/lib/php/7.3/modules/mysqli.so (Error relocating /usr/lib/php/7.3/modules/mysqli.so: zend_hash_next_index_insert: symbol not found)) in Unknown on line 0

zend_hash_next_index_insert: symbol not found

PS. With phpearth/php:7.2-litespeed no any issues

Primary script unknown

2019-08-12_183655_app1 local

I use the duplicator to clone my site for local environment. When installing, it says it does not have write permission to the directory

docker-compose.yml:

version: '3.3'

services:
  app:
    image: phpearth/php:7.3-nginx
    volumes:
      - ./public_html:/var/www/html
    environment:
      - VIRTUAL_HOST=app1.local

networks:
  default:
    external:
      name: net-lemp

At the server console shows this:
[error] 15#15: *15 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 172.18.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "172.18.0.5"
Can you help me?

Psr Extension

Hello,

can you include the psr plugin in your repo?

Thanks

[Question] php earth alpine repo is missing php7.4-mcrypt

Docker image creation failed.

I tried to update one of our docker image to use php7.4-nginx, while doing it I found that php earth maintains it's own alpine repos which is currently missing php7.4-mcrypt package.

Alternatives tried:

  • I also tried to change repo to use official alpine repository. It also failed as it couldn't verify signature.

Error output from alpine official package:

Step 7/14 : RUN apk update && apk add --no-cache   php7.4-gd   php7.4-imap   php7.4-intl   php7.4-mbstring   php7.4-mcrypt   php7.4-ldap   php7.4-soap   php7.4-curl
 ---> Running in 9a5beb324403
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
fetch https://repos.php.earth/alpine/v3.9/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
SSL certificate subject doesn't match host dl-cdn.alpinelinux.org
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.9/community: Permission denied
WARNING: Ignoring APKINDEX.d18d1ece.tar.gz: No such file or directory
v3.9.4-229-gc99c0aa831 [http://dl-cdn.alpinelinux.org/alpine/v3.9/main]
v3.9.4-228-g3b5d75ca3d [http://dl-cdn.alpinelinux.org/alpine/v3.9/community]
1 errors; 10119 distinct packages available
The command '/bin/sh -c apk update && apk add --no-cache   php7.4-gd   php7.4-imap   php7.4-intl   php7.4-mbstring   php7.4-mcrypt   php7.4-ldap   php7.4-soap   php7.4-curl' returned a non-zero code: 1

It mentions that we have SSL error.

SSL certificate subject doesn't match host dl-cdn.alpinelinux.org
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.9/community: Permission denied
WARNING: Ignoring APKINDEX.d18d1ece.tar.gz: No such file or directory

Any suggestion on how I should move forward. Any hint?

Bump PHP versions

PHP 7.3 is not in RC anymore, and 7.3.1 has just been released with a couple of security fixes. 5.6, 7.1 and 7.2 also received updates.

New extension: blackfire.io probe

RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
     && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/$version \
     && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
     && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
     && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini

using with apache

Hey, thanks for the project, super helpful.

I've been trying to deploy with apache, and I'm having some issues.

if my dockerfile reads identically to the getting started, everything works

FROM phpearth/php:7.2-nginx

but if I use the apache image instead

FROM phpearth/php:7.2-apache

I get stuck with "it works" at localhost instead of my files. Could you point me to some docs? thanks!

Add MQSeries php module

This might be in a wrong place, this is more related to the alpine repository I think, but I'll open it here first so anybody who comes from the docker hub could see it directly.

It would be nice to have the IBMs WebSphere MQ series Queue managers module. It needs some work to build it and it would help a lot for enterprises who building on top of IBM systems: http://php.net/manual/en/book.mqseries.php

New extension: firebird

As mentioned in the #1 the firebird/interbase and pdo_firebird are missing since they are not possible to build without some core patches of the firebird code. Opening this issue to tracking possible progress here.

Manual composer installation failed with error

I tried to install composer the usual way from inside the container but it failed with error message.

Docker container: phpearth/php:7.1-cli

Installation Command

$ curl -sS https://getcomposer.org/installer|php

Error reported by the system.

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The phar extension is missing.
Install it or recompile php without --disable-phar

build docker container based on 7.1-cli tag and try to install composer manually. I tried to do a manual installation so that I can have the latest version of composer but it failed with above error message.

For now I have used the alpine packaged composer version.

apache, nginx, litespeed, cgi short tags

So using the lattest is very convenient and I would like to not specify the php version for apache, nginx, litespeed and cgi versions so I could roll my applications with the stable php version. If something goes wrong with and upgrade the tests will fail, so we could upgrade the necessary parts whenever it's needed to keep the code up to date.

phpearth/php:7.4-litespeed not found

Goodafternoon,

When i try to use the litespeed image for php7.4 it returns a 404 not found. You can also see on your github page the tag returned a 404. Can you please push the build?

Thank you! I love the repository!

php 7.4 gd requires libiconv

/usr/lib/php/7.4/modules # php -m
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd' (tried: /usr/lib/php/7.4/modules/gd (Error loading shared library /usr/lib/php/7.4/modules/gd: No such file or directory), /usr/lib/php/7.4/modules/gd.so (Error relocating /usr/lib/php/7.4/modules/gd.so: libiconv: symbol not found)) in Unknown on line 0

To reproduced:

$ docker run --rm -it phpearth/php:7.4-cli sh

/ # apk add php7.4-gd
/ # php -m|grep -i gd
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd' (tried: /usr/lib/php/7.4/modules/gd (Error loading shared library /usr/lib/php/7.4/modules/gd: No such file or directory), /usr/lib/php/7.4/modules/gd.so (Error relocating /usr/lib/php/7.4/modules/gd.so: libiconv: symbol not found)) in Unknown on line 0
/ #

cc @petk

SSL certificate expired

Hello!
We are using phpearth/php:7.3-nginx docker image and we had a problem during building containers. SSL certificate in https://repos.php.earth is expired today (2 March). Please, renew SSL certificate.

MPM not loaded?

I am having a weird issue on a RHEL 7.4 box. Whenever I try to run a fairly simply docker container, it seems to successfully build except for a warning:

Enabling module rewrite.
find: '/var/lib/apache2/module/enabled_by_maint/mpm_event': No such file or directory
To activate the new configuration, you need to run:
service apache2 restart

The image seems to build anyways and I try to start it. It fails and I get this error:

AH00534: apache2: Configuration error: No MPM loaded.

I tried to load mod_mpm_event.so into the httpd.conf manually, but while building I am told the file doesn't exist.

I have included my dockerfile here. Hoping someone has some ideas! Thanks.

FROM php:7.2-apache

RUN set -x \
	&& apt-get update && apt-get install unzip -y \
        && apt-get install -y libldap2-dev ldap-utils \
        && apt-get install -y git openssh-server \
        && rm -rf /var/lib/apt/lists/* \
        && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
        && docker-php-ext-install ldap \
        && apt-get purge -y --auto-remove libldap2-dev
RUN a2enmod rewrite

#RUN echo "LoadModule mpm_event_module modules/mod_mpm_event.so" >> /usr/local/apache2/conf/httpd.conf

EXPOSE 8080:80

I've also tried php:latest with the same error. Docker version is reporting 1.13.1

unable to get PHP v 7.2.8 - latest version is 7.2.7

newer php exists - PHP 7.2.9

 docker run --rm --entrypoint=php phpearth/php:latest -v
Unable to find image 'phpearth/php:latest' locally
latest: Pulling from phpearth/php
ff3a5c916c92: Already exists
6e58ae251a6d: Pull complete
5fec3f891fb1: Pull complete
Digest: sha256:031e5883605294c928ba332cf2a6310ebc1c568563b910891c50f8d48e13e1b9
Status: Downloaded newer image for phpearth/php:latest
PHP 7.2.7 (cli) (built: Jun 22 2018 11:43:41) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

php-fpm.conf is missing

After install of any extension like "php7.1-pdo_pgsql", docker delete /etc/php/7.1/*.conf files, so fpm not work anymore.

Sample Dockerfile:
FROM phpearth/php:7.1-nginx
RUN apk add --no-cache php7.1-pdo_pgsql

Docker version: 18.03.1.ce-1.el7.centos
Linux: centos 7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.