serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.67k stars 109 forks source link

APACHE_DOCUMENT_ROOT is Misdocumented? /var/www/html/public instead of /var/www/html ?? #300

Closed pha3z closed 5 months ago

pha3z commented 5 months ago

Affected Docker Images

FROM serversideup/php:beta-8.3-fpm-apache

Docker Labels of the affected images

n/a

Current Behavior

The official documentation says APACHE_DOCUMENT_ROOT Default: "/var/www/html" https://serversideup.net/open-source/docker-php/docs/reference/environment-variable-specification

However, I notice when I launch my container I get this output:

❌ There seems to be a failure in checking the web server + PHP-FPM. Here's the response:

**AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist**
**AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist**
[Mon Apr 01 02:36:33.497979 2024] [mpm_event:notice] [pid 156:tid 131727784310656] AH00489: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Mon Apr 01 02:36:33.498246 2024] [core:notice] [pid 156:tid 131727784310656] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'

I take it that the documentation is wrong and I should put all my web files in /public.

Expected Behavior

I expect files to be served from /var/www/html since that's what documentation says. But I think doc is wrong.

Steps To Reproduce

Launch new image

Host Operating System

Ubuntu 22.04

Docker Version

Client: Docker Engine - Community
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:17:48 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:17:48 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Anything else?

No response

jaydrogers commented 5 months ago

Yes it was misdocumented. Sorry for the confusion! I updated the docs to reflect the default is /var/www/html/public.

Thanks for pointing this out!