File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package caddy
22
33import (
44 "encoding/json"
5+ "fmt"
56 "log"
67 "log/slog"
78 "net/http"
@@ -104,7 +105,11 @@ func cmdPHPServer(fs caddycmd.Flags) (int, error) {
104105 if _ , err := os .Stat ("php.ini" ); err == nil {
105106 iniScanDir := os .Getenv ("PHP_INI_SCAN_DIR" )
106107
107- if err := os .Setenv ("PHP_INI_SCAN_DIR" , iniScanDir + ":" + frankenphp .EmbeddedAppPath ); err != nil {
108+ newDir := frankenphp .EmbeddedAppPath
109+ if iniScanDir != "" {
110+ newDir = iniScanDir + ":" + newDir
111+ }
112+ if err := os .Setenv ("PHP_INI_SCAN_DIR" , newDir ); err != nil {
108113 return caddy .ExitCodeFailedStartup , err
109114 }
110115 }
@@ -124,6 +129,8 @@ func cmdPHPServer(fs caddycmd.Flags) (int, error) {
124129
125130 if root == "" {
126131 root = defaultDocumentRoot
132+ caddy .Log ().Warn (fmt .Sprintf ("No root path specified, using default: %q" , defaultDocumentRoot ))
133+ caddy .Log ().Warn (`If you would like to serve from the embedded app directory, specify "root ./" ` )
127134 }
128135 }
129136
You can’t perform that action at this time.
0 commit comments