Documentation
¶
Overview ¶
Package caddy provides a PHP module for the Caddy web server. FrankenPHP embeds the PHP interpreter directly in Caddy, giving it the ability to run your PHP scripts directly. No PHP FPM required!
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrankenPHPApp ¶
type FrankenPHPApp struct { // NumThreads sets the number of PHP threads to start. Default: 2x the number of available CPUs. NumThreads int `json:"num_threads,omitempty"` // Workers configures the worker scripts to start. Workers []workerConfig `json:"workers,omitempty"` }
func (FrankenPHPApp) CaddyModule ¶
func (f FrankenPHPApp) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*FrankenPHPApp) Start ¶
func (f *FrankenPHPApp) Start() error
func (*FrankenPHPApp) Stop ¶
func (f *FrankenPHPApp) Stop() error
func (*FrankenPHPApp) UnmarshalCaddyfile ¶
func (f *FrankenPHPApp) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
type FrankenPHPModule ¶
type FrankenPHPModule struct { // Root sets the root folder to the site. Default: `root` directive, or the path of the public directory of the embed app it exists. Root string `json:"root,omitempty"` // SplitPath sets the substrings for splitting the URI into two parts. The first matching substring will be used to split the "path info" from the path. The first piece is suffixed with the matching substring and will be assumed as the actual resource (CGI script) name. The second piece will be set to PATH_INFO for the CGI script to use. Default: `.php`. SplitPath []string `json:"split_path,omitempty"` // ResolveRootSymlink enables resolving the `root` directory to its actual value by evaluating a symbolic link, if one exists. ResolveRootSymlink *bool `json:"resolve_root_symlink,omitempty"` // Env sets an extra environment variable to the given value. Can be specified more than once for multiple environment variables. Env map[string]string `json:"env,omitempty"` // contains filtered or unexported fields }
func (FrankenPHPModule) CaddyModule ¶
func (FrankenPHPModule) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*FrankenPHPModule) Provision ¶
func (f *FrankenPHPModule) Provision(ctx caddy.Context) error
Provision sets up the module.
func (FrankenPHPModule) ServeHTTP ¶
func (f FrankenPHPModule) ServeHTTP(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler. TODO: Expose TLS versions as env vars, as Apache's mod_ssl: https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go#L298
func (*FrankenPHPModule) UnmarshalCaddyfile ¶
func (f *FrankenPHPModule) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.