Skip to content

[Bug]: Herd installed PHP version will not use the Herd configuration files without specifying them manually #693

Closed
@trueparallels

Description

@trueparallels

Platform

macOS

Operating system version

macOS Ventura 13.6.3

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.6 (build 24)

PHP Version

PHP 8.3.6 (cli) (built: Apr 12 2024 00:13:56) (NTS)

Bug description

I specifically need Memcached installed to run our local test suite, and the current iteration of Herd does not include the module by default. I compiled the memcached module using the instructions here.

Here is my current php.ini file at ~/Library/Application Support/Herd/config/php/83/php.ini:

extension=/opt/homebrew/lib/php/pecl/20230831/memcached.so

auto_prepend_file = /Users/<redacted>/.composer/vendor/spatie/global-ray/src/scripts/global-ray-loader.php
curl.cainfo=/Users/<redacted>/Library/Application Support/Herd/config/php/cacert.pem
openssl.cafile=/Users/<redacted>/Library/Application Support/Herd/config/php/cacert.pem
pcre.jit=0

memory_limit=2048M
upload_max_filesize=2M

zend_extension=/Applications/Herd.app/Contents/Resources/xdebug/xdebug-83-arm64.so
xdebug.mode=debug,develop
xdebug.start_with_request=yes
xdebug.start_upon_error=yes
xdebug.log_level=0

Here's my installed version:

$ which php && php -v
/Users/<redacted>/Library/Application Support/Herd/bin/php
PHP 8.3.6 (cli) (built: Apr 12 2024 00:13:56) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies

And here's the output when using php -m on the CLI (with and without specifying the config manually)

$ herd php -m | grep -i memcached
$ herd php -c ~/Library/Application\ Support/Herd/config/php/83/php.ini -m | grep -i memcached
memcached
$

I assuming this is a bug based on this snippet from the Changing PHP.ini settings page of the docs:

The changes will be immediately available to the PHP CLI version, but you will need to restart all Herd services to apply the changes to HTTP requests via nginx.

Steps to reproduce

No response

Relevant log output

No response

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