diff --git a/caddy/php-cli.go b/caddy/php-cli.go index 0d9f38e16..3ff7b9481 100644 --- a/caddy/php-cli.go +++ b/caddy/php-cli.go @@ -3,6 +3,7 @@ package caddy import ( "errors" "os" + "path/filepath" caddycmd "github.com/caddyserver/caddy/v2/cmd" "github.com/dunglas/frankenphp" @@ -30,6 +31,12 @@ func cmdPHPCLI(fs caddycmd.Flags) (int, error) { return 1, errors.New("the path to the PHP script is required") } + if frankenphp.EmbeddedAppPath != "" { + if _, err := os.Stat(args[0]); err != nil { + args[0] = filepath.Join(frankenphp.EmbeddedAppPath, args[0]) + } + } + status := frankenphp.ExecuteScriptCLI(args[0], args) os.Exit(status)