Tag: php

how load mysql extensions dockerfile with Docker, Compose with Pfm and Nginx and Mysql

I’m new to Docker & Compose. I’ve created a Docker.yml file with nginx, fpm & mysql. docker-compose.yml runs without errors… I can execute php commands (ie see the results of php commands in browser) but I can’t execute mysqli commands. phpinfo.php shows ‘–enable-mysqlnd’ and it appears to be installed. Configuration File (php.ini) Path /usr/local/etc/php is […]

Nginx, PHP-FPM, MySQL and Symfony using Docker : Nginx 502 Bad Gateway and Symfony No route found exception

This post will be quite long, so make sure you have something to drink near you. Basically, I want to use Docker to make an Nginx container, a PHP-FPM container, a MySQL container and a Symfony container which will contain the code of my Symfony app. I’ve been trying to make things work for a […]

Retain environment variable values for Symfony2 app development in Docker

I have a Symfony2 app running inside Docker container. The parameters.yml file is set to pick environment variables as following: framework: secret: “%env.secret%” … The Docker compose file contents are: services: my-website: env_file: my-website.env build: . expose: – “80” volumes: – .:/app The environment variables file is: SYMFONY__ENV__SECRET=1234567890 … Everything works fine when accessed via […]

WordPress, Docker and nginx

Ubuntu Server 14.04 LTS. I’m running WordPress as a standard install, i.e in /var/www/html. I also have a Discourse instance running in a Docker container, with port 8081 exposed. My intention is to have the WP instance at domain.com and Discourse on sub.domain.com. I’ve tried using nginx to intercept requests for sub.domain.com but it doesn’t […]

Elastic search not working as expected

I have used this query ‘body’ => [ ‘query’ => [ ‘bool’ => [ ‘should’ => [ [‘match’ => [‘title’=> $q]], [‘match’ => [‘year’=> $q]], [‘match’ => [‘case_type’=> $q]], [‘match’ => [‘body’=> $q]], [‘match’ => [‘petition_no’=> $q]], [‘match’ => [‘keywords’=> $q]] ] ] ] ] and I don’t know why I am not getting the […]

Creating a docker-compose with PHP drivers for mongo+memcache+ES

I’m new to Docker and I’m trying to dockerize an existing application. Currently the application is all-in-one machine that has a PHP server and a web application and mongo + memcache + elastic search. I’m trying to have the following: 1. Container based of the web application with PHP installed. I think that nimmis/apache-php5 can […]

Nginx + php-fpm: Bad gateway only when xdebug server is running

Problem When xdebug server is running from IntelliJ IDEA, I get 502 Bad Gateway from nginx when I try loading my site to trigger breakpoints. If I stop the xdebug server, the site works as intended. So, I’m not able to run the debugger, but it did work previously (!). Not able to pinpoint why […]

Docker container connection to gateway refused

While setting up a php dev environment with docker, I ran into an issue while setting up remote debugging (XDEBUG) through a dbgp proxy. Connecting my host machine to the proxy doesn’t seem to be a problem, but the proxy container cannot reach my host machine over the port that is configured (in this case […]

Docker – Install PDO Driver for PHP + Nginx

I have a Dockerfile: FROM php:7-fpm RUN apt-get update \ && apt-get install -y –no-install-recommends libpq-dev \ && docker-php-ext-install mysqli pdo_pgsql pdo_mysql Then I have in my docker-compose.yml file: web: image: nginx:latest ports: – “80:80” volumes: – ./frontend:/var/www/html – ./api:/var/www/html/api – ./nginx/default.conf:/etc/nginx/conf.d/default.conf links: – php mysql: image: mariadb ports: – “3306:3306” environment: – MYSQL_ROOT_PASSWORD=password – […]

Using xdebug through Docker container in PhpStorm

I’ve read some posts about this but none helped in my case or simply overlooked the missing piece. I cannot get xdebug to work on PhpStorm using a Docker container. Docker-compose.yml version: ‘2’ services: web: image: nginx:latest volumes: – .:/usr/share/nginx/html – ./nginx/nginx.conf:/etc/nginx/nginx.conf – ./nginx/logs:/var/logs/nginx – ./nginx/site-enabled/default.conf:/etc/nginx/sites-enabled/default.conf ports: – “80:80” depends_on: – php db: image: mysql:5.7 […]

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