Tag: php

Laravel not working showing Apache default page on localhost. Virtual Host changes failed

I have to make LAravel app and to deliver a Dockerfile ,but i’m realy stuck with this. Before that I had a nightmare wile installing laravel on my machine. I’m trying to get dockervel image and I’m following the steps here: http://www.spiralout.eu/2015/12/dockervel-laravel-development.html I had problems before and made changes :Error starting userland proxy: listen tcp0.0.0.0:3306: […]

PHPUnit testing FAILS ONLY when visiting the root page( visit('/') ) in Laravel 5

I run Laravel applic ation in docker container dockervel and the test <?php use Illuminate\Foundation\Testing\WithoutMiddleware ; use Illuminate\Foundation\Testing\DatabaseMigrations ; use Illuminate\Foundation\Testing\DatabaseTransactions ; use App\User1; class MyTest extends TestCase { public function testExample() { $this->assertTrue(true); } public function providerAllUrisWithResponseCode() { return [ [‘/’, 200], [‘/thank’, 200], [‘/non-existing’, 404], ]; } public function testDisplayThankYou($value=”) { $this->visit(‘/thankyou’) ->see(‘THank […]

Installing cPhalcon on AWS Docker Image

I have a docker image that installs phalcon onto a Docker image. Here is the Dockerfile: FROM ubuntu:trusty MAINTAINER Fernando Mayo <fernando@tutum.co>, Feng Honglin <hfeng@tutum.co> # Install packages ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ sudo apt-get -y install supervisor php5-dev libpcre3-dev gcc make php5-mysql git curl unzip apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc […]

How to install dependencies via Composer for Symfony project in Dockerfile?

I’ve met a problem related to making Docker container image, that contains Symfony base application. I can install php extensions without any problem (mcrypt, pdo_mysql, etc), but I can’t install dependencies via Composer. So… I’ve got, that I have problems related to caching and forming file autoload.php. I can’t understand why, but it tries connect […]

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

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