phalcon / homebrew-tap

Official Homebrew tap for Phalcon PHP Framework (brew install phalcon)
https://docs.phalcon.io/4.0/en/installation#macos
17 stars 16 forks source link

Apple M1 issue when brew install phalcon, returns Operation not permitted #29

Open louiemiranda opened 2 years ago

louiemiranda commented 2 years ago

The entire build log.

2022-06-24 04:25:36 +0000

make
install

Installing shared extensions:     /opt/homebrew/Cellar/php@7.4/7.4.30/pecl/20190902/
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/pecl/20190902/#INST@69982#: Operation not permitted
make: *** [install-modules] Error 1
make: *** Waiting for unfinished jobs....
Installing header files:          /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@70927#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@70999#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71071#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71143#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71215#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71287#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71359#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71431#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71503#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71575#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71647#: Operation not permitted
cp: /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/#INST@71719#: Operation not permitted
make: [install-headers] Error 1 (ignored)

HOMEBREW_VERSION: 3.5.2-145-gfe853fc
ORIGIN: https://github.com/Homebrew/brew
HEAD: fe853fcb9e57249d62e2381b831a884cfa853f37
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ee8a23537d7672bc9173a5ee5f74053fafa5c750
Core tap last commit: 61 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_BOOTSNAP: set
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 13.1.6 build 1316
Git: 2.32.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.83.1 => /opt/homebrew/opt/curl/bin/curl
macOS: 12.4-arm64
CLT: 13.4.0.0.1.1651278267
Xcode: N/A
Rosetta 2: false

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /opt/homebrew/opt/apr:/opt/homebrew/opt/openssl@1.1:/opt/homebrew/opt/apr-util:/opt/homebrew/opt/m4:/opt/homebrew/opt/openldap:/opt/homebrew/opt/curl:/opt/homebrew/opt/icu4c:/opt/homebrew/opt/krb5:/opt/homebrew/opt/libpq:/opt/homebrew/opt/readline:/opt/homebrew/opt/sqlite:/opt/homebrew/opt/php@7.4:/opt/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /opt/homebrew/opt/apr/lib/pkgconfig:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig:/opt/homebrew/opt/apr-util/lib/pkgconfig:/opt/homebrew/opt/argon2/lib/pkgconfig:/opt/homebrew/opt/brotli/lib/pkgconfig:/opt/homebrew/opt/libidn2/lib/pkgconfig:/opt/homebrew/opt/libnghttp2/lib/pkgconfig:/opt/homebrew/opt/libssh2/lib/pkgconfig:/opt/homebrew/opt/openldap/lib/pkgconfig:/opt/homebrew/opt/rtmpdump/lib/pkgconfig:/opt/homebrew/opt/zstd/lib/pkgconfig:/opt/homebrew/opt/curl/lib/pkgconfig:/opt/homebrew/opt/unixodbc/lib/pkgconfig:/opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/fontconfig/lib/pkgconfig:/opt/homebrew/opt/jpeg/lib/pkgconfig:/opt/homebrew/opt/imath/lib/pkgconfig:/opt/homebrew/opt/openexr/lib/pkgconfig:/opt/homebrew/opt/libtiff/lib/pkgconfig:/opt/homebrew/opt/webp/lib/pkgconfig:/opt/homebrew/opt/jpeg-xl/lib/pkgconfig:/opt/homebrew/opt/libvmaf/lib/pkgconfig:/opt/homebrew/opt/aom/lib/pkgconfig:/opt/homebrew/opt/libavif/lib/pkgconfig:/opt/homebrew/opt/gd/lib/pkgconfig:/opt/homebrew/opt/gmp/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/krb5/lib/pkgconfig:/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/libsodium/lib/pkgconfig:/opt/homebrew/opt/libzip/lib/pkgconfig:/opt/homebrew/opt/oniguruma/lib/pkgconfig:/opt/homebrew/opt/pcre2/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/tidy-html5/lib/pkgconfig:/opt/homebrew/opt/pcre/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/12
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
ACLOCAL_PATH: /opt/homebrew/opt/curl/share/aclocal:/opt/homebrew/share/aclocal
PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/autoconf/bin:/opt/homebrew/opt/apr/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/apr-util/bin:/opt/homebrew/opt/argon2/bin:/opt/homebrew/opt/aspell/bin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/brotli/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/libidn2/bin:/opt/homebrew/opt/openldap/bin:/opt/homebrew/opt/rtmpdump/bin:/opt/homebrew/opt/zstd/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/libtool/bin:/opt/homebrew/opt/unixodbc/bin:/opt/homebrew/opt/freetds/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/fontconfig/bin:/opt/homebrew/opt/jpeg/bin:/opt/homebrew/opt/giflib/bin:/opt/homebrew/opt/openexr/bin:/opt/homebrew/opt/libtiff/bin:/opt/homebrew/opt/webp/bin:/opt/homebrew/opt/jpeg-xl/bin:/opt/homebrew/opt/libvmaf/bin:/opt/homebrew/opt/aom/bin:/opt/homebrew/opt/libavif/bin:/opt/homebrew/opt/gd/bin:/opt/homebrew/opt/icu4c/bin:/opt/homebrew/opt/krb5/bin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/opt/libzip/bin:/opt/homebrew/opt/oniguruma/bin:/opt/homebrew/opt/pcre2/bin:/opt/homebrew/opt/sqlite/bin:/opt/homebrew/opt/tidy-html5/bin:/opt/homebrew/opt/php@7.4/bin:/opt/homebrew/opt/pcre/bin:/usr/bin:/bin:/usr/sbin:/sbin

Tried to chmod 777 the folder /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/psr/, but still has cp issue. Tried other phalcon version, but it's still the same.

What could be wrong here?

jrobinsonuk commented 2 years ago

Having had the same problem here are my steps for the solution:

Try the install once to setup php etc, so this error occurs

Download psr and compile from source: https://github.com/jbboehr/php-psr into the /opt/homebrew/Cellar/php@7.4/7.4.30/include/php/ext/ directory You will need to use the suggested call

cd <directory where source is downloaded>
/opt/homebrew/opt/php@7.4/bin/phpize
./configure --prefix=/opt/homebrew/Cellar/phalcon@4.0.4/4.0.4 --with-php-config=/opt/homebrew/opt/php@7.4/bin/php-config --enable-phalcon
make
make test
sudo make install

Remove the psr dependency from the brew build. In my case I was running 4.0.4 brew edit phalcon@4.0.4

Comment out depend_on psr

  depends_on "pcre"
  # depends_on "psr"

Run the install to complete the install brew install phalcon@4.0.4

You will then need to edit the php ini file to include the path to psr.so nano /opt/homebrew/etc/php/7.4/conf.d/ext-phalcon.ini