Skip to content

Incorrect PHP script resolution and missing FastCGI host params break WordPress #18

Description

@mirkobrombin

The PHPPlugin cannot serve a stock WordPress site because it resolves SCRIPT_FILENAME relative to the server process working directory via filepath.Join(".", r.URL.Path) instead of the site root_directory, so PHP-FPM receives a wrong path and replies File not found with a 404; on top of that it never maps directory requests to an index file, so visiting / returns index.php served as text/plain rather than being executed, and it forwards no host information to FPM, so application-generated redirects come out without a host such as http://wp-admin/install.php. Resolving the script against an absolute root_directory, mapping empty or trailing-slash paths to index.php, and passing HTTP_HOST, SERVER_NAME, SERVER_PORT, HTTPS, CONTENT_TYPE, CONTENT_LENGTH and HTTP_COOKIE to FPM makes WordPress work end to end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions