Tag: php

php-fpm & nginx in separated docker container, can not execute .php file

I’d like to setup an completely LNMP environment with docker on a machine. But there is something wrong with separated php-fpm & nginx container. What I’v done is : pull images from docker.io : docker pull php:7.1-fpm docker pull nginx run with image : docker run -d –name php-fpm -v /data/Docker/php-fpm/configs/:/usr/local/etc/php-fpm.d -v /data/Docker/nginx/html:/var/www/html php:7.1-fpm docker […]

FOS user bundle doesn't keep logged session

I have integrated the FOS user bundle just as the quick guide tells you to do. it seem to work except that once I log in and redirects it loses the session for some reason and I’m back as anonymous user. This is what i get when I log in before I’m redirect back: As […]

How to create docker environments for production and development that match

I’m planning to use docker for PHP development. One question remains open: Examples I have found online suggests that I would mount my source folder to the development container as a volume. Then, when I change some code, the changes would be immediately available in the container. After changing something I could run relevant test […]

Docker + nginx multi-domain configuration problems

Try to configure the official nginx.conf dockingers nginx.conf configuration failed, very little on their knowledge to find a lot of information did not find a solution. Here’s what I tried: YBa docker run -d –name YBa –restart=always -v /Storage/Volumes/App/YBa:/usr/src/myapp php YBb docker run -d –name YBa –restart=always -v /Storage/Volumes/App/YBb:/usr/src/myapp php Nginx docker run -d -p […]

How to set new folders inherit folder permission in Docker volume on Mac

I am using Docker-machine on Mac for a PHP application. My code is shored in mac, and shared to docker-machine as volume. This is my docker-compose.yml app: build: . volumes: – .:/var/www/html My PHP application will create a folder in the shared volume and write some files in it. The shared volume is set to […]

Uncaught exception 'RedisException' with message 'Connection closed'

Trying to set up a redis session on my php inside a Docker container, it gives me the above error message when loading the php page. I read this question http://stackoverflow.com/questions/35993130/phpseclib-fatal-error-uncaught-exception-runtimeexception-with-message-conn but it didn’t help me. I run redis and httpd/php on the same host inside a docker container. From a simple php script I […]

Multi Docker container with PHP7 fpm and nginx

I am having issues with setting up a multi docker container environment. The idea is pretty standard: One container have php-fpm running Another is a nginx proxy My phpfpm Docker file is as simple as: FROM php:7.0-fpm # install the PHP extensions we need RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev && rm […]

Can't make nginx and php-fpm dockers communicate

I have created two docker images to match my needs, here is the nginx one: FROM alpine:3.3 RUN apk add –update nginx EXPOSE 80 443 CMD nginx -c /www/dev/nginx/conf/nginx.conf -g ‘daemon off;’ then the php-fpm FROM php:7.0-fpm RUN apt-get update RUN apt-get install -y apt-transport-https ca-certificates dcmtk libgdcm-tools wkhtmltopdf libdbd-freetds libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev […]

Docker “Operation not permitted” issue on Windows

I’m trying to use Docker on Windows through Docker Toolbox, but I’m struggling to make it work. I’ve pulled Docker PHP image. For example, this simple ls command fails: $ docker run -it –rm -v /$(pwd):/home/projects php:7.0-cli ls -l /home/projects ls: cannot open directory /home/projects: Operation not permitted Also, any other operation within the mounted […]

PHP application moving to Docker failed to connect on AWS

I have an application that is currently running successfully in the following configuration: nginx platform PHP 7.0 redis driver pdo driver running under an ec2 instance ubuntu, connecting to an rds instance to a mysql 5.6. My goal is to start slowly migrating the application to self contained docker component for php. here is the […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.