Installation failing in macOS M1
Output
❯ phpbrew lookup-prefix homebrew
/usr/local/opt:/usr/local
~
❯ phpbrew install 7.0 +default
===> phpbrew will now build 7.0.33
===> Loading and resolving variants...
Homebrew prefix "/opt/homebrew/opt/libxml2" does not exist.
Homebrew prefix "/opt/homebrew/opt/mhash" does not exist.
Homebrew prefix "/opt/homebrew/opt/curl" does not exist.
Checking distribution checksum...
Checksum matched: 4933ea74298a1ba046b0246fe3771415c84dfb878396201b56cb5333abe86f07
===> Distribution file was successfully extracted, skipping...
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Checking patch for replace freetype-config with pkg-config on php older than 7.4
Found existing build.log, renaming it to /Users/cs/.phpbrew/build/php-7.0.33/build.log.1631539204
===> Configuring 7.0.33...
Use tail command to see what's going on:
$ tail -F '/Users/cs/.phpbrew/build/php-7.0.33/build.log'
Error: Configure failed:
The last 5 lines in the log file:
checking for EXSLT support... not found
checking for zip archive read/writesupport... yes
checking pcre install prefix... /opt/homebrew/opt/pcre
checking libzip... no
checking for the location of zlib... configure: error: zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
Please checkout the build log file for more details:
tail /Users/cs/.phpbrew/build/php-7.0.33/build.log
Expected Result
Successfully installed
Platform
OS: macOS 11.4
Running PHP: 7.3.24
Installing PHP: 7.0.33
Log after running the following command
phpbrew install 7.0 -- \--with-zlib-dir=`brew --prefix zlib`
Console output
❯
phpbrew install 7.0 -- \--with-zlib-dir=`brew --prefix zlib`
===> phpbrew will now build 7.0.33
You haven't enabled any variants. The default variant will be enabled:
[bcmath, bz2, calendar, cli, ctype, dom, fileinfo, filter, ipc, json, mbregex, mbstring, mhash, pcntl, pcre, pdo, pear, phar, posix, readline, sockets, tokenizer, xml, curl, openssl, zip]
Please run 'phpbrew variants' for more information.
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: 4933ea74298a1ba046b0246fe3771415c84dfb878396201b56cb5333abe86f07
===> Distribution file was successfully extracted, skipping...
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Checking patch for replace freetype-config with pkg-config on php older than 7.4
Found existing build.log, renaming it to /Users/cs/.phpbrew/build/php-7.0.33/build.log.1631539727
===> Configuring 7.0.33...
Use tail command to see what's going on:
$ tail -F '/Users/cs/.phpbrew/build/php-7.0.33/build.log'
===> Checking patches...
Checking patch for php5.3.x on 64bit machine when intl is enabled.
Checking patch for openssl dso linking patch
0 changes patched.
Checking patch for php5.6 with openssl 1.1.x patch.
===> Building...
Error: Make failed:
The last 5 lines in the log file:
/Users/cs/.phpbrew/build/php-7.0.33/ext/pcre/pcrelib/sljit/sljitConfigInternal.h:301:2: note: expanded from macro 'SLJIT_CACHE_FLUSH'
sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
^
3 errors generated.
make: *** [ext/pcre/pcrelib/pcre_jit_compile.lo] Error 1
Please checkout the build log file for more details:
tail /Users/cs/.phpbrew/build/php-7.0.33/build.log
~ 1m 10s
me too
add --without-pcre-jit at the end may make it work.
Refer to: #1249
It seems the solution is available in the previous reply.
And please refer the https://github.com/phpbrew/phpbrew/issues/1275#issuecomment-1336714290 reply.
According to the above reply, I build/compile the latest PHP 8.1 version with PHPBrew on macOS 11.6.
It's worked successfully.
Personally I just had to give up trying to install older version of PHP7 on M2 as the build kept failing for one reason or another, mainly around the [email protected] missing symbols for arm64.
Ultimately I just had to install 7.4 through brew as a last resort to do what I needed to do for now: https://stackoverflow.com/a/75925537/378506