Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
zip -r php.zip ./

- name: Install packages
run: brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libxslt libzip pkg-config re2c zlib
run: brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libxslt libzip openssl@3 pkg-config re2c zlib

- name: Test
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PHP installation requires some dependencies. Please install the dependencies bas
To install PHP on macOS, you'll need a set of packages installed via homebrew.

```shell
brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip pkg-config re2c zlib
brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip openssl@3 pkg-config re2c zlib
```

There's also a set of optional packages which enable additional extensions to be enabled:
Expand Down
19 changes: 17 additions & 2 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install_php() {
local libedit_path=$(homebrew_package_path libedit)
local libxml2_path=$(homebrew_package_path libxml2)
local libxslt_path=$(homebrew_package_path libxslt)
local openssl_path=$(homebrew_package_path openssl@1.1)
local openssl_path=$(homebrew_openssl_path)

if [ -n "$bison_path" ]; then
export "PATH=${bison_path}/bin:${PATH}"
Expand Down Expand Up @@ -163,6 +163,21 @@ homebrew_package_path() {
fi
}

# Resolve the OpenSSL path to use for building PHP.
#
# Homebrew disabled openssl@1.1 on 2024-10-24, so the long-standing
# `openssl@1.1` reference no longer resolves on a modern macOS. PHP 7.4+
# builds fine against OpenSSL 3, so we prefer `openssl@3` and fall back
# to `openssl@1.1` only if it still happens to be installed (older PHP
# branches that still need it).
homebrew_openssl_path() {
local path=$(homebrew_package_path openssl@3)
if [ -z "$path" ]; then
path=$(homebrew_package_path openssl@1.1)
fi
echo "$path"
}

exit_if_homebrew_not_installed() {
if [ "$(brew --version 2>/dev/null)" = "" ]; then
echo "ERROR: Please install homebrew for OSX"
Expand Down Expand Up @@ -190,7 +205,7 @@ os_based_configure_options() {
local libxml2_path=$(homebrew_package_path libxml2)
local libxslt_path=$(homebrew_package_path libxslt)
local libzip_path=$(homebrew_package_path libzip)
local openssl_path=$(homebrew_package_path openssl@1.1)
local openssl_path=$(homebrew_openssl_path)
local readline_path=$(homebrew_package_path readline)
local webp_path=$(homebrew_package_path webp)
local zlib_path=$(homebrew_package_path zlib)
Expand Down