5

I am trying to install HD-Wallet Derive on my new MacBook Pro with the Apple A1 chip. For which I need to install the latest version of PHP (7.3 at this current time). So when I hit this command brew install php@7.3 on my terminal (Z shell) and I get this error message:

Error: php@7.3: no bottle available!

You can try to install from source with:

brew install --build-from-source php@7.3

Please note building from source is unsupported. You will encounter build failures with some formulae. If you experience any issues please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels.

I am building it from source, using the repository hd-wallet-derive. I was able to execute this commands curl https://getcomposer.org/installer -o installer.php and this php installer.php successfully. But when I ran this one: php composer.phar install

I get this error:

No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.

Loading composer repositories with package information
Updating dependencies

Your requirements could not be resolved to an installable set of packages.

Problem 1

  • mdanter/ecc[v0.5.0, ..., 0.5.x-dev] require ext-gmp * -> it is missing from your system. Install or enable PHP's gmp extension.
  • bitwasp/bitcoin dev-master requires mdanter/ecc ^0.5.0 -> satisfiable by mdanter/ecc[v0.5.0, v0.5.1, v0.5.2, 0.5.x-dev].
  • Root composer.json requires bitwasp/bitcoin dev-master#8782bc6c470e342d4e0cb67eb036974f133b950b -> satisfiable by bitwasp/bitcoin[dev-master].

I believe I have to do a GMP extension, but how?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
vmieres
  • 91
  • 1
  • 1
  • 7
  • 1
    7.3 is old and unsupported, and unlikely to be backported to run on Apple ARM. 7.4 and 8.0 are the currently supported releases. If you’re not comfortable building from source, I’m not sure what answer you expect to get here. – miken32 Feb 06 '21 at 14:54
  • I am having an issue here too. I require php 7.3 specifically, not php 8.0. I am working with a Laravel installation that breaks with php 8, so that wouldn't make sense. – Darren Murphy Feb 24 '21 at 21:49
  • @miken32 I have installed php8.0. But, PHP extensions pgsql and pdo_pgsql are not working. Without that, I can't do laraval development. Any solutions for that? – Jinto Antony Mar 11 '21 at 05:22
  • ("Derive" is [not a typo](https://github.com/dan-da/hd-wallet-derive#installation-and-running) of "Drive" - *"hd-wallet-derive is a command-line tool that derives bip32 addresses and private keys for Bitcoin and many altcoins."*) – Peter Mortensen Apr 10 '23 at 20:04
  • 2
    What is Apple A1? A4 is from 2013. Do you mean [Apple S1](https://en.wikipedia.org/wiki/Apple_silicon#Apple_S1) (explainable by a typo. Though it is from 2014)? [Apple M1](https://en.wikipedia.org/wiki/Apple_silicon#Apple_M1)? Apple A11? Apple A12? – Peter Mortensen Apr 10 '23 at 20:05

3 Answers3

27
brew tap shivammathur/php
brew install shivammathur/php/php@7.3

Note: PHP 7.3 is end of life by 6 Dec 2021.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JasonHorsleyTech
  • 392
  • 1
  • 5
  • 11
0

Apple A1 is an ARM architecture chip. You are going to have to install from source (and compile them yourself) or wait for maintainers to update Homebrew scripts with switches for ARM architectures more about it at Homebrew installation on ARM #357.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ryan H
  • 400
  • 2
  • 9
  • "Apple A1" is in the question, but does it [make any sense](https://stackoverflow.com/questions/66070561/installing-php-7-3-on-a-new-macbook-pro-with-the-new-a1-chip-apple-silicon/67204182#comment134008346_66070561)? – Peter Mortensen Apr 10 '23 at 20:05
0

In the latest MAC OS with Apple Chips, there is no php installed by default or it might be showing deprecated while in the previous versions there were php installed builtin from OS. Now If you want to download older php version in your "latest OS", you need to follow the few steps below in order to do everything set up.

Step 1: go to https://brew.sh/ and install HomeBrew by copying and pasting the below line into your terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

remember at the end the terminal will give you a code to run again in order to make the HomeBrew path global. To check that HomeBrew is successfully setup use brew -v it will give you the version of your homebrew.

Step 2:

brew tap shivammathur/php
brew install shivammathur/php/php@7.3

Step 3:

 brew link php@7.3 

If it is already linked it will show you, otherwise it will give you two commands to run just copy it and then again run on terminal. The php path will be setup successfully.

Step 4:

php -v

In order to check your php version.

Sabaoon Bedar
  • 3,113
  • 2
  • 31
  • 37