Browse Source

Resolved issue with PHP files not displaying properly

main
Simon Bowie 3 years ago
parent
commit
ff5b63507d
4 changed files with 13 additions and 36 deletions
  1. +3
    -4
      docker-compose.yml
  2. +9
    -23
      nginx/default.conf
  3. +0
    -9
      php/Dockerfile
  4. +1
    -0
      site/public/test.php

+ 3
- 4
docker-compose.yml View File

@@ -1,10 +1,10 @@
version: '3.8'

services:

php:
container_name: php
build:
context: ./php
image: php:8.0-fpm
env_file:
- config.env
ports:
@@ -18,9 +18,8 @@ services:
ports:
- '8080:80'
volumes:
- ./site:/var/www/html
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
volumes_from:
- php

solr:

+ 9
- 23
nginx/default.conf View File

@@ -1,33 +1,19 @@
server {

listen 80;
index index.php;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;

location / {
try_files $uri /index.php$is_args$args;
}

location ~ ^/index\\.php(/|$) {
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
fastcgi_index index.php;
include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

internal;
}

location ~ \\.php$ {
return 404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}

}

+ 0
- 9
php/Dockerfile View File

@@ -1,9 +0,0 @@
FROM php:8.0-fpm

#RUN apt update \
# && apt install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip \
# && docker-php-ext-install intl opcache pdo pdo_mysql \
# && pecl install apcu \
# && docker-php-ext-enable apcu \
# && docker-php-ext-configure zip \
# && docker-php-ext-install zip

+ 1
- 0
site/public/test.php View File

@@ -0,0 +1 @@
testing

Loading…
Cancel
Save