kabel / homebrew-php-ext

🐘🌐 Core PHP extension formulae not suitable for Homebrew/core
BSD 2-Clause "Simplified" License
122 stars 18 forks source link

Installing PHP 7.4 IMAP extension M1 #33

Closed jamielsharief closed 3 years ago

jamielsharief commented 3 years ago

Hi,

I just tried to install the php-imap extension for PHP 7.4 on the Mac M1 but it downloaded the PHP 8 package.

> brew tap kabel/php-ext
Updating Homebrew...
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.

==> Tapping kabel/php-ext
Cloning into '/opt/homebrew/Library/Taps/kabel/homebrew-php-ext'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 374 (delta 2), reused 4 (delta 2), pack-reused 366
Receiving objects: 100% (374/374), 74.37 KiB | 555.00 KiB/s, done.
Resolving deltas: 100% (243/243), done.
Tapped 18 formulae (56 files, 131.9KB).
jimbo /opt
> brew install php-imap
==> Installing php-imap from kabel/php-ext
==> Downloading https://homebrew.bintray.com/bottles/php-8.0.1_1.arm64_big_sur.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/ee47f0fe24f240ad10bddd12acf144a04bb0e551d55275ae497fc1fc6fdf49c9?response-conte
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/imap-uw-2007f_1.arm64_big_sur.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/c2f21ac938fd8cad640bb7c5ffc7f9fbc74d783485483914554742f0c1fe0cd8?response-conte
######################################################################## 100.0%
==> Downloading https://www.php.net/distributions/php-8.0.1.tar.xz
######################################################################## 100.0%
==> Installing dependencies for kabel/php-ext/php-imap: php and imap-uw
==> Installing kabel/php-ext/php-imap dependency: php
==> Pouring php-8.0.1_1.arm64_big_sur.bottle.tar.gz
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set php_ini /opt/homebrew/etc/php/8.0/php.ini system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set php_dir /opt/homebrew/share/pear system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set doc_dir /opt/homebrew/share/pear/doc system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set ext_dir /opt/homebrew/lib/php/pecl/20200930 system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set bin_dir /opt/homebrew/opt/php/bin system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set data_dir /opt/homebrew/share/pear/data system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set cfg_dir /opt/homebrew/share/pear/cfg system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set www_dir /opt/homebrew/share/pear/htdocs system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set man_dir /opt/homebrew/share/man system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set test_dir /opt/homebrew/share/pear/test system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear config-set php_bin /opt/homebrew/opt/php/bin/php system
==> /opt/homebrew/Cellar/php/8.0.1_1/bin/pear update-channels
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.0/

To have launchd start php now and restart at login:
  brew services start php
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Summary
🍺  /opt/homebrew/Cellar/php/8.0.1_1: 499 files, 77.8MB
==> Installing kabel/php-ext/php-imap dependency: imap-uw
==> Pouring imap-uw-2007f_1.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/imap-uw/2007f_1: 152 files, 9.1MB
==> Installing kabel/php-ext/php-imap
==> /opt/homebrew/opt/php/bin/phpize
==> ./configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-imap=/opt/homebrew/opt/imap-uw --with-imap-ssl=/opt/homebrew
==> make
🍺  /opt/homebrew/Cellar/php-imap/8.0.1: 8 files, 1MB, built in 17 seconds
==> Caveats
==> php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.0/

To have launchd start php now and restart at login:
  brew services start php
Or, if you don't want/need a background service you can just run:
  php-fpm

Here is my brew list, I don't even have PHP installed.

> brew list
adns        curl        gnupg       libev       libpq       mysql-client    pcre2       sqlite
apr     fontconfig  gnutls      libevent    libsodium   nettle      php     tcl-tk
apr-util    freetds     guile       libffi      libssh2     nghttp2     php-imap    tidy-html5
argon2      freetype    icu4c       libgcrypt   libtasn1    npth        php@7.4     unbound
aspell      gd      imap-uw     libgpg-error    libtiff     oniguruma   pinentry    unixodbc
autoconf    gdbm        jemalloc    libidn2     libtool     openldap    pkg-config  webp
bdw-gc      gettext     jpeg        libksba     libunistring    openssl@1.1 python@3.9  xz
brotli      glib        krb5        libmetalink libusb      p11-kit     readline    zstd
c-ares      gmp     libassuan   libpng      libzip      pcre        rtmpdump
kabel commented 3 years ago

You may be new the the homebrew environment. Popular packages, like php, are available in different versions. Those packages are available with the @ symbol followed by the desired version. The packages with the @ sign follow the latest stable version available from upstream, which is php 8.0.

You're looking for brew install php@7.4-imap