Giter VIP home page Giter VIP logo

dockerised-php's People

Contributors

andygrunwald avatar cipriantepes avatar mikechernev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockerised-php's Issues

Can't upload file

I used your stack and modified code/index.php like below:

<form method="post">
  <input type="file" name="upload">
  <input type="submit" name="submit" value="Submit">
</form>
<pre>
<?php
//phpinfo();
if (count($_FILES)) {
  var_dump($_FILES);
} else {
  echo "No file upload<br>";
}
var_dump($_SERVER['REQUEST_METHOD']);
?>
</pre>

And result after i choose a file and submit.

No file upload
string(4) "POST"

Attempting to use to serve laravel - Receiving blank page , plus no info in logs

@mikechernev

I am trying to use this to serve laravel app...pretty close to working but need help on a few tweaks:

I placed your repository in a folder named docker within my root project folder. I mount the parent folder as a volume. Like so:

web:
    image: nginx:latest
    ports:
        - "8089:80"
    volumes:
        - ../:/code
        - ./site.conf:/etc/nginx/conf.d/site.conf
    links:
        - php
php:
    image: php:7-fpm
    volumes:
        - ../:/code

Then I modify site.conf root to be /code/public which has index.php like so:

server {
    index index.php index.html;
    server_name php-docker.local;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /code/public;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

I am receiving a blank page when navigating to php-docker.local:8089. I have verified the basic configuration is working before attempting to serve the laravel project.

I wanted to look at the access and error logs, but cat access.log leads me to a black hole. ls- l gives me

`
lrwxrwxrwx 1 root root 11 Apr 5 18:53 access.log -> /dev/stdout

lrwxrwxrwx 1 root root 11 Apr 5 18:53 error.log -> /dev/stderr
`
which look like sym links.... was there a trick to get the nginx log I am forgetting? Anything else you see wrong?

Thanks for posting this, saw it in the docker email

Adding mysql

Is possible add mysql to this docker-compose?

php service should have depends_on web service

If the web service is started before the php service, You'll get an nginx error:

[emerg] 1:1: host not found in upstream "php" in /etc/nginx/conf.d/default.conf:12

Amending the config for web like so will correct this problem:

web:
  # ... other configs
  depends_on:
    - php

subfolders

Not sure if this is issue related, but there appears to be a lack of understanding on how to allow sub folders to exist. What would be the recommendation from our site.conf file to allow any sub folder to exist and be accessible in the browser after we do our normal docker-compose up -d?

This is my sample code I'm working on based on a tutorial:

server {
    index index.php index.html;
    server_name php-docker.local;
    error_log  root /var/log/nginx/error.log;
    access_log root /var/log/nginx/access.log;
    root /phpweb;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

Thanks for any direction

Changing non-PHP files doesn't update the container volume

I added a simple .html file, but changing its content have no effect on the volume (I guess) I hit F5 on the browser and my changes doesm't shows up. I only can see my changes when I rename the project folder (I guess it creates a new volume).

How to add a PDO driver for PostgreSQL?

This is really cool and I learned a lot but it seems the only pdo driver included is sqlite.

I need to access a postgres database on a remote machine with this. How do I add it? I have searched docker hub and every extension I can find is using mysql (ick).

Thanks for any tips.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.