Tag: php

Behat, MySql Connection error in Laravel5 : 'PDOException''SQLSTATE[HY000] [2005] Unknown MySQL server host 'mysql' (2)'

I run Laravel applic ation in docker container dockervel and my feature is : Feature: Registation form In order to test register on this site As a visitor I need to fill in the necessary info Scenario: Given I am on the homepage Then I should see “Welcome” When I run vendor/bin/behat I get this […]

Docker PHP Sessions Not Persisting

Running a Laravel App on Docker (Windows), everything works perfectly, except when I Auth::attempt() it works and Auth::check() is also True, but when the page is refreshed (or different page) Auth::check() is False. It seems like everytime I refresh the session id changes. The exact code works on: XAMPP Vagrant Homestead Ubuntu server on Azure […]

DOCKER + PDO: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

When trying to connect a dockerized PHP-Application to a MySQL-Container, I get the following error: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) Dockerfile: FROM tutum/apache-php RUN rm -fr /app COPY . /app ENV DB_HOST=192.168.99.100 ENV DB_NAME=azk ENV DB_USER=root ENV DB_PW=my-secret-pw If I do not use PDO, the connection works, so […]

Giving php-fpm user 'www-data' permission to write to directories owned by Docker root in container

Using php-fpm in a Docker container causes problems when writing files. The php-fpm runs as user ‘www-data’ and all the directories/files which are volume mounted in by Docker are owned by user root. How can I change the permissions that www-data has from the Dockerfile using sed?

Add yaml parse to php.ini file using docker

I’m trying to add yaml_parse_file extension on my docker container. On the Dockerfile I add this line to add the extension on the php.ini file: echo ‘extension=yaml.so’ >> /usr/local/etc/php/php.ini But when I run docker-compose build I get this warning: PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20121212/yaml.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20121212/yaml.so: cannot open shared object […]

Docker php with composer PSR-4

Im trying to publish my webpage using docker on my nas. But Can’t get the PSR-4 to work, it wont find the controllers through the namespacing. Everything worked on my vagrant box. But as long as I don’t extend a class it wont break Whoops \ Exception \ ErrorException (E_ERROR) Class ‘Rsubscribe\Controllers\BaseController’ not found bootstrap/start.php […]

Advice needed on how to setup a SAAS service for a php based application

I have worked with a certain php and mysql based crm application for a while as a developer and know it inside out. I have an idea to offer an on-demand saas based hosted version where the client and can purchase a plan based on the number of users. They will simply click a button […]

installing ldap extension Docker

Hey all I am trying to instal ldap extension on a Docker php:5.6-fm images i need ldap for my project. I have tired to install the extension through Dockerfile like so: RUN apt-get install php5-ldap -y get this error: The LDAP PHP extension is not enabled. I have also find some ‘suggestion’ online like so: […]

Docker nginx oci runtime error: could not synchronise with container process: not a directory

Can anyone help me fix this on docker? I am new to docker and I’m currently exploring docker-compose. Below are my docker-compose.yml file and the error I get when I run docker-compose up. Thanks in advance! 🙂 docker-compose.yml version: ‘2’ services: php: container_name: php_server image: php:7-fpm volumes: – ./web:/code nginx: container_name: nginx_server image: nginx:latest volumes: […]

nginx + PHP-FPM: Doing away with fastcgi params

I’m doing a little experiment, a hypothesis if you will. The main idea is simple: three Docker containers, one is simply a data container with an index.php in it at /app/web/ that simply outputs phpinfo(); This works fine. I have an nginx container that also is working fine, and a separate PHP-FPM container. Both are […]

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