Skip to content

PCRE JIT allocation error when compiling PHP <= 8.0 on macOS 15 (Apple Silicon M4) #19209

@adeshmrane

Description

@adeshmrane

Description

I'm trying to compile PHP 8.0.30 (and earlier versions) on macOS 15 Sequoia, running on an Apple Silicon M4 chip.

During the build process, I encountered the following fatal error related to PCRE JIT memory allocation while generating phar.phar:

Fatal error: Uncaught InvalidArgumentException: RegexIterator::__construct(): 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 /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php:1133 Stack trace:
#0 /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php(1133): RegexIterator->__construct(Object(RecursiveIteratorIterator), '/\\.svn/')
#1 /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php(1077): PharCommand::phar_add(Object(Phar), 0, '/Users/pc/Deskt...', NULL, '/\\.svn/', Object(SplFileInfo), NULL, true)
#2 /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php(225): PharCommand->cli_cmd_run_pack(Array)
#3 /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php(2089): CLICommand->__construct(19, Array)
#4 {main} thrown in /Users/pc/Desktop/nsetup/setups/src/php-8.0.30/ext/phar/phar.php on line 1133 make: *** [ext/phar/phar.phar] Error 255

Steps to Reproduce:

  1. Download PHP 8.0.30 source from php.net
  2. Run the following configuration on macOS 15 (M4):
    ./configure --with-iconv=shared,/Applications/AMPPS/apps && make
  3. Compilation fails when building phar.phar

This issue does not occur when compiling PHP 8.1 or newer on the same system.

PHP Version

PHP 8.0.30

Operating System

Macos 15

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions