Open NasirNobin opened 2 years ago
Possible paths:
- /usr/local/opt/php@7.2/bin
- /usr/local/opt/php@7.2/bin
- /opt/homebrew/etc/php/7.0/bin
- /opt/homebrew/opt/php@7.0/bin
- /usr/local/opt/php@5.6/bin
- /usr/local/opt/php@7.3/bin
- /usr/local/Cellar/php/8.0.2/bin
- /usr/local/Cellar/php/8.1.2/bin
-
Sources:
use brew --prefix
to determine homebrew prefix
from valet
/**
* Typical homebrew path resolutions are like:
* "../Cellar/php@7.4/7.4.13/bin/php"
* or older styles:
* "../Cellar/php/7.4.9_2/bin/php
* "../Cellar/php55/bin/php.
*/
preg_match('~\w{3,}/(php)(@?\d\.?\d)?/(\d\.\d)?([_\d\.]*)?/?\w{3,}~', $resolvedPath, $matches);
Currently, this package assumes PHP binary is located at
/opt/homebrew/opt/php@$PHP_VERSION/bin
But older homebrew versions don't store PHP bin into
/opt/homebrew/
prefix also, it doesn't store on the same location.