Skip to content

[Bug]: herd_auto_prepend_file works, but herd_auto_append_file doesn't #1379

@doubleedesign

Description

@doubleedesign

Platform

Windows

Operating system version

Windows 11 (23H2 22631.3155)

System architecture

Windows

Herd Version

1.19.1

PHP Version

8.3, 8.4

Bug description

I'm using Herd for a vanilla PHP project, and have added the following lines to php.ini to automatically put my opening and closing HTML on each rendered page:

herd_auto_prepend_file = C:/Users/MY_USERNAME/path/to/project/wrapper-open.php
herd_auto_append_file = C:/Users/MY_USERNAME/path/to/project/wrapper-close.php

wrapper-open.php works as expected, but wrapper-close.php is not appended.

I have also tried using auto_append_file without herd_, which doesn't work either.

Any assistance to get this to work would be much appreciated :)

Steps to reproduce

  1. Create a project with three PHP files: wrapper-open.php, wrapper-close.php, my-page.php (e.g., in a folder called sample-project) and add some simple HTML to them (example attached)
  2. Add the project as a Herd site
  3. Open the php.ini file for the current global PHP version
  4. Add the following with the paths updated to match your system:
herd_auto_prepend_file = C:/Users/MY_USERNAME/path/to/project/wrapper-open.php
herd_auto_append_file = C:/Users/MY_USERNAME/path/to/project/wrapper-close.php
  1. Visit https://sample-project.test/my-page.php
  2. Observe that the content of wrapper-open.php and my-page.php are shown in the browser, but wrapper-close.php is not.

sample-project.zip

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions