Tag: php

“Could not delete ./” when I use composer in docker

When I build my dockerfile, it just show that. Did anyone tried to use composer in docker? Or is there any other way to install the flarum into docker? PS: the user is root. Downloading https://packagist.org/packages.json Writing /root/.composer/cache/repo/https—packagist.org/packages.json into cache Downloading http://packagist.org/p/provider-2013%24d6b22cfddabf0741ef0c5c720daf4f0a5f17ed112a30074bfeef5007a1e30590.json Writing /root/.composer/cache/repo/https—packagist.org/p-provider-2013.json into cache Downloading http://packagist.org/p/provider-2014%2471316c49d46d6c1e66f1d56e3cd12020169065922e83ed72e3319f00146bf8cf.json Writing /root/.composer/cache/repo/https—packagist.org/p-provider-2014.json into cache Downloading http://packagist.org/p/provider-2015-01%244a1f70479a6d65b81b75a0db8f73f0cce3fa08a6f828fe1c93bda72f1943b88d.json Writing […]

PHP date.timezone not found with Docker & PHP-FPM

I’m creating a Symfony environment (PHP-FPM, Nginx, & more) with Docker & Docker-compose. But, PHP does not use my php.ini and ignores the config (date.timezone parameter is not found in my Symfony application). Of course, when I go on my container, the date.timezone is correctly set in the 2 php.ini (cli & FPM). I don’t […]

xdebug only gets triggered via running script from cli and not browser

I have a Docker container running apache2 php5 and xdebug. I can only trigger xdebug when I run a php script from the command line via root on the docker container. I get an xdebug log file with the following entries: Log opened at 2015-11-12 19:34:30 I: Checking remote connect back address. I: Checking header […]

cURL to DropBox using Symfony 3

I use the Gaufrette Bundle of Symfony to access DropBox API. The code in my controller is $dropbox = $this->get(‘acme.dropbox.api’); $dropbox->getAccountInfo(); I get an error Curl error: (77) error setting certificate verify locations: CAfile: rootca CApath: /etc/ssl/certs 500 Internal Server Error – Dropbox_Exception_NotFound I used Docker so not sure if it’s with the way I […]

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 […]

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