Catalina sh: /usr/local/bin/php: Bad CPU type in executable

I have been wrecking my head over this, since a week now.

I am on Mac catalina.

I have installed PHP 7.3 using brew.

$php -v
PHP 7.3.11 (cli) (built: Feb 29 2020 02:50:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
$echo $PATH
$find /usr -name php
find: /usr/sbin/authserver: Permission denied

I am using zsh as terminal. Still, time and again, I get “Bad CPU in executable” issue.

Case in context, I am trying to install the sage theme from roots/trellis

$php composer.phar create-project roots/sage site/web/app/themes/sage
... a lot of installation goes well
... ends with
Generating autoload files
> Roots\Sage\Installer\ComposerScript::postCreateProject
sh: /usr/local/bin/php: Bad CPU type in executable
sh: /usr/local/bin/php: Bad CPU type in executable
sh: /usr/local/bin/php: Bad CPU type in executable

Can anyone please guide me here?

Try which php on terminal and compare the resulting path to the path of PHP executable composer invokes instead.

This topic was automatically closed after 42 days. New replies are no longer allowed.