title: PHP cannot write in docker container
body: <p>I'm trying to create a workflow in docker.
  It's simple: just PHP and MySQL to little tests.</p>
  
  <p>My <strong>docker-compose.yml</strong>:</p>
  
  <pre><code>web:
    build: .docker
    links:
      - mysql:mysql
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./public_html:/var/www/html
  mysql:
    image: mysql:5.7
    environment:
      - MYSQL_ROOT_PASSWORD=root
    volumes:
      - "./.data/db:/var/lib/mysql"
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - "8080:80"
    links:
      - mysql:mysql
    environment:
      - PMA_HOST=mysql
    volumes:
      - /sessions</code></pre>
  
  <p>And my <strong>Dockerfile</strong>:</p>
  
  <pre><code>FROM php:5.6-apache
  
  RUN docker-php-ext-install mysqli</code></pre>
  
  <p>It's all ok: I can up containers but PHP itself cannot write in directories (like <code>fwrite()</code> or similar).</p>
  
  <p>I researched a lot and tried a lot of tutorials, but nothing...</p>