skip to Main Content

MacOS 10.15 Catalina installed version of PHP7.3.8 does not include the PHP extension zip. How do I go about finding and installing that zip extension.

Brew install php73-zip reports no available formula with that name.

2

Answers


  1. Homebrew formula/package php is compiled with the zip extension enabled by default.

    Homebrew is Homebrew, it’s not MacPorts or any other Linux package manager. There’s no need to install another package to enable the zip extension. Please check the fact before report the problem.

    # https://github.com/Homebrew/homebrew-core/blob/48a3a49c57b22eb1450b01e7867cf054a89c5a7b/Formula/php.rb#L31
    class Php < Formula
      desc "General-purpose scripting language"
      homepage "https://www.php.net/"
      url "https://www.php.net/distributions/php-7.3.10.tar.xz"
      sha256 "42f00a15419e05771734b7159c8d39d639b8a5a6770413adfa2615f6f923d906"
    
    ...
    
      depends_on "libsodium"
      depends_on "libzip"
      depends_on "openldap"
    
    ...
    
          --enable-wddx
          --enable-zip
          --with-apxs2=#{Formula["httpd"].opt_bin}/apxs
    
    ...
    
          --with-libedit#{headers_path}
          --with-libzip
          --with-mhash#{headers_path}
    ...
    
    Login or Signup to reply.
  2. here is what I found @ install ext-zip for Mac

    I had the same problem after updating my Mac to Catalina. Here is what worked for me.

    brew update
    brew install [email protected]
    brew link [email protected]
    

    Then reload your console.

    It will install PHP 7.3.10 with the zip module. You can use PHP -v to check for the version, and PHP -m for the modules.


    Side note: in case you don’t have Homebrew (brew) installed
    you can visit: https://brew.sh/

    A basic install of Homebrew (brew)

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    Paste that in a macOS Terminal prompt.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search