Tag: php

Docker cannot write to assets folder as web server process in Yii/PHP application locally OS X

appreciate if you could help me. I’m running docker VM in a MAC OS X and seems okay until i reach a permissions error when my app is trying to write files in the assets folder in the server: CAssetManager.basePath “/var/www/html/assets” is invalid. Please make sure the directory exists and is writable by the Web […]

php ftp_get() not working in Docker container

I am trying to retrieve a file from an ftp in a Docker container using php. The script I have works locally, but the file is not being retrieved from Docker. Here is my Dockerfile FROM debian:jessie RUN apt-get update && apt-get install -y php5-cli php5-curl git cron ca-certificates ADD startup.sh / CMD [“/startup.sh”] startup.sh […]

Trying to run php-fpm on Docker

I´m following this tutorial about setting up my own LEMP server with Docker. The author of the tutorial uses the following line in the Dockerfile: RUN docker-php-ext-install -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) iconv gd mbstring fileinfo curl xmlreader xmlwriter spl ftp mysqli But it keeps throwing me the following error: Step 3 : […]

Setting up docker on Mac OS – php-intl cannot be installed

I have the following problem: I want set up a development environment on my Mac using docker and boot2docker. For that I created an image using the below Dockerfile. The Problem is, that my php-intl-Extension cannot be installed.. I tried various method. For example to enable it in php.ini via: extension=php_intl.so None of the methods […]

Unable to connect to unix:///var/run/docker.sock (Permission denied) from PHP code

I use Docker Windows Toolbox I created the docker container with PHP-FPM: docker run -d -v /var/run/docker.sock:/var/run/docker.sock php:7.0-fpm-alpine If I use curl directly from container shell: curl –unix-socket /var/run/docker.sock http://containers/json I got correct answer. But if use PHP code: $socket = stream_socket_client(‘unix:///var/run/docker.sock’, $errno, $errstr); if ($socket){ $request = ‘GET /version HTTP/1.1’.”\r\n”; $request.= ‘Connection: Close’.”\r\n\r\n”; fwrite($socket,$request); […]

PHP-CLI Docker with extension

I want to run php file with one line docker run command. docker run -v “$PWD”:/home -w /home php:5.6-fpm php /home/irc_bot.php It actually works but within the target file, I use socket_create(), and I got the error “Call to undefined function socket_create()”. Here I’d love to enable it in php.ini. Is it possible? or Do […]

php composer inside container lost vendor directory

I have the following Dockerfile FROM bitgandtter/sf:php7 # basic env fix ENV TERM xterm # install packages ADD . /var/www # update dependencies RUN cd Helpers && SYMFONY_ENV=prod composer update -o –no-dev ENV SYMFONY_ENV prod After build the image the Helpers directory does not contain the vendor directory. I really dont know why is that […]

Enter docker container from host using docker-machine

How can I connect to Php container from my Windows machine? I run docker toolbox https://www.docker.com/products/docker-toolbox on my Windows 10 machine. It’s create docker-machine (env default) using virtualbox on port tcp:// and from host machine (Windows) I can connect to it by ssh. Inside docker-machine I run containers with docker-compose. I run PhpStorm on Windows […]

Doctrine missing “WHERE” clause

I’m attempting to move my Behat tests from Jenkins (which builds a server each run), to Docker, so that I can add it to Travis. I’ve run in to a little problem where the WHERE part of a query isn’t being inserted by Doctrine. The DQL output is this: SELECT v FROM \Database\Entity\SoftwareVersion v WHERE […]

Multiple Websites and PHP Versions with Docker-Compose

At the moment I’m building my own dev environment because I want to get rid of MAMP. I created a docker-compose file with a nginx proxy and it’s basically working. My problem is, that several old php projects require different php versions. Here is how far I already got with my compose file: version: ‘2’ […]

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