When setting auto_prepend_file then restarting it, herd will automatically remap it to herd_auto_prepend_file
But, when herd then runs with the auto_prepend_file like this, it does not respect the autoprepend.
Setting the auto_prepend_file to something other than the heard defaults does stop the dump() additions, which is not preferred, I have currently managed a workaround by creating a custom auto_prepend_file that does a require of the global one I need, as well as Herd's.
In the steps I have provided just php 8.3 but I have had this issue for 7.4 as well, so I assume it is the same as every file.
Steps to reproduce
Some paths have been truncated for privacy and ease of reading.
Show the setup.
➜ herd-example php -v
PHP 8.3.13 (cli) (built: Oct 25 2024 00:21:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.13, Copyright (c) Zend Technologies
with Zend OPcache v8.3.13, Copyright (c), by Zend Technologies
➜ herd-example php -i | grep "prepend"
auto_prepend_file => /Applications/Herd.app/Contents/Resources/valet/dump-loader.php => /Applications/Herd.app/Contents/Resources/valet/dump-loader.php
error_prepend_string => no value => no value
➜ herd-example echo "auto_prepend_file=$(realpath autoprepend.php)" >> ~/Library/Application\ Support/Herd/config/php/83/php.ini
➜ herd-example php -i | grep "prepend"
auto_prepend_file => .../herd-example/autoprepend.php => .../herd-example/autoprepend.php
error_prepend_string => no value => no value
➜ herd-example php some-application.php
foo%
Restart the herd app
➜ herd-example php -i | grep "prepend"
auto_prepend_file => /Applications/Herd.app/Contents/Resources/valet/dump-loader.php => /Applications/Herd.app/Contents/Resources/valet/dump-loader.php
error_prepend_string => no value => no value
it's been set as herd_auto_prepend_file now, hm, okay\
but this never get's loaded.
➜ herd-example php some-application.php
Fatal error: Uncaught Error: Call to undefined function my_global_function() in .../herd-example/some-application.php:3
Stack trace:
#0 {main}
thrown in .../herd-example/some-application.php on line 3
Platform
macOS
Operating system version
macOS Sequoia 15.0.1
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.11.1 (Build 34)
PHP Version
No response
Bug description
When setting
auto_prepend_file
then restarting it, herd will automatically remap it toherd_auto_prepend_file
But, when herd then runs with the auto_prepend_file like this, it does not respect the autoprepend. Setting the auto_prepend_file to something other than the heard defaults does stop the
dump()
additions, which is not preferred, I have currently managed a workaround by creating a customauto_prepend_file
that does a require of the global one I need, as well as Herd's.In the steps I have provided just php 8.3 but I have had this issue for 7.4 as well, so I assume it is the same as every file.
Steps to reproduce
Some paths have been truncated for privacy and ease of reading.
Show the setup.
Application Setup
Setup auto_prepend_file and confirm.
Restart the herd app
my auto prepend has been reset
it's been set as herd_auto_prepend_file now, hm, okay\ but this never get's loaded.
Relevant log output
No response