garrettmassey's avatar

garrettmassey wrote a reply+100 XP

5mos ago

running the grep for the loaded config file shows "(none)"

garrettmassey's avatar

garrettmassey started a new conversation+100 XP

5mos ago

We recently inherited a PHP7.4 site, and I'm trying to set up the environment locally so that I can begin working with it, but when I switch my PHP version to 7.4 in Herd, and try to run composer install (or try to run any composer command) I am met with this error:

Fatal error: Uncaught ErrorException: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in phar:///Users/garrettmassey/Library/Application Support/Herd/bin/composer/vendor/symfony/console/Output/StreamOutput.php:121
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'preg_match(): A...', 'phar:///Users/g...', 121, Array)
#1 phar:///Users/garrettmassey/Library/Application Support/Herd/bin/composer/vendor/symfony/console/Output/StreamOutput.php(121): preg_match('/^((screen|xter...', 'xterm-256color')
#2 phar:///Users/garrettmassey/Library/Application Support/Herd/bin/composer/vendor/symfony/console/Output/StreamOutput.php(51): Symfony\Component\Console\Output\StreamOutput->hasColorSupport()
#3 phar:///Users/garrettmassey/Library/Application Support/Herd/bin/composer/vendor/symfony/console/Output/ConsoleOutput.php(42): Symfony\Component\Console\Output\Str in phar:///Users/garrettmassey/Library/Application Support/Herd/bin/composer/vendor/symfony/console/Output/StreamOutput.php on line 121

So, I checked the .ini for PHP7.4 in Herd, and this is what it shows:

curl.cainfo=/Users/garrettmassey/Library/Application Support/Herd/config/php/cacert.pem
openssl.cafile=/Users/garrettmassey/Library/Application Support/Herd/config/php/cacert.pem
pcre.jit=0
output_buffering=4096

memory_limit=128M
upload_max_filesize=32M
post_max_size=32M

which looks corret, the pcre.jit is set. When I switch back to any PHP8+ version I can run composer, but because this particular site requires 7.4, I get errors stating:

- Root composer.json requires php ^7.4 but your php version (8.2.28) does not satisfy that requirement.

I've restarted Herd several times, but it doesn't seem to work. Not sure where to proceed from here.