Tag: php

Docker application upload on AWS elastic beanstalk fails

I am using docker images for running web-app on PHP and MongoDB. Docker container is running perfectly on my local machine (Windows10) but it is not updating on AWS Elastic Beanstalk. I have made a zipped file consist of run.sh, Dockerfile, and Dockerrun.aws.json which can be found from here. On AWS Elastic Beanstalk I am […]

Access rest api endpoint docker

I have built simple api endpoint using symfony/fosrest etc. I can access it via symfony build in server ie: php bin/console server:run. Now I want to access api in docker. I have created docker-compose.yml with php-apache and mysql image. Now when I try to connect to the endpoints as follows I get forbidden (403) error. […]

Access MySQL from 3 other docker containers

Currently I am trying to set up three different docker containers (php and apache) and let them listen to 4th in which my sql server is running. Does somebody know how can I get my mysql container listen to the 3 other containers?

Cannot connect to PostgreSQL in Docker through PHP

I’m cant connect to PostgreSQL with php code. My Postgresql is docker container. I get an IP with: docker inspect toshi_db_1 How I’m trying to connect: $dbconn = pg_connect(“host= port=5432 dbname=toshi_development”)or die(“Could not connect”); Error: Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection timed out (0x0000274C/10060) Is the server […]

Docker fails to install php mysql extension

I’m just trying to get a simple docker dev environment setup, but docker is not installing php‘s mysql extension. I get a fatal error – Call to undefined function mysql_connect(). I’ve tried different php versions (5.4, 5.5, 5.6, 7.0) all with the same result. Any help would be appreciated. docker-compose.yml version: ‘2’ volumes: database_data: driver: […]

Nginx proxy pass real ip doesn't work

I run a nginx reverse proxy server in the docker container. And the backend is a apache server running on the host, which is listening 10082 port. Laravel handle the request. And I use $request->getClientIp() to get real ip. However, the result of visiting the server by http://myip:10082 directly without proxy conflicts with the result […]

How to stop the client IP address getting lost in a Cloudflare/Docker/NGINX/LAMP site?

The problem is the PHP field $_SERVER[‘HTTP_CLIENT_IP’] is not being set in my following site structure, how should I correct this? Static IP containers on a Docker bridge network (on a host behind cloudflare) named ‘back’: NGINX running in container (172.24.02) Apache + PHP in container ( nginx.conf: location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header […]

prepend command with env variable – including sub command

I need to add an environment variable to the php artisan migrate commands of Laravel for use with docker, like: env DB_HOST= php artisan migrate I created a function in my .zshrc file like this: function migrate() { (env DB_HOST= php artisan migrate $*) } however the way Laravel’s command structure works is like this: […]

Behat Mink file upload not finding file on submit

I’m trying to test an image upload using Selenium/Mink with Behat in a Symfony application. The application is running in a Docker container. I’m attaching the file directly to the NodeElement of the input rather than use $driver->attachFileToField(‘#id-of-input’, $filePath) because we’re dealing with a lot of inputs in the context and already have the input […]

Missing js/css files in frontend of contao cms

i was making a local copy of a working live instance of a contao website (contao version 3.4.0). i copied web folder and made a dump of database. the site works on local in general but several files (e.g. slider js/css) are missing with following error in console: “Failed to load resource: the server responded […]

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