Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac M1 not able to map PHP 8.0 as a CLI Interpreter within PhpStorm

I'm trying to set up the PhpStorm CLI interpreter on my New M1 Mac Book. PHP 8.0 itself is running fine, but I cannot add it as a CLI Interpreter within PhpStorm.

// installation commands

brew install php
brew link [email protected]

// which php

/opt/homebrew/bin/php

// php -v

 PHP 8.0.2 (cli) (built: Feb  4 2021 12:48:26) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.2, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies
    sebastian@nbch003 ~ % 

// php --ini

Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.0
Loaded Configuration File:         /opt/homebrew/etc/php/8.0/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.0/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/8.0/conf.d/error_log.ini,
/opt/homebrew/etc/php/8.0/conf.d/ext-opcache.ini,
/opt/homebrew/etc/php/8.0/conf.d/php-memory-limits.ini

Usually, within the PhpStorm CLI Interpreter Settings, I map just the Path to the Current PHP Installation, but this time, PhpStorm does not recognize the PHP 8.0 Interpreter.

enter image description here

enter image description here

Compared to my old setup, on this path, no bin folder is present to select.

Any ideas?

like image 667
Stan Barrows Avatar asked Sep 10 '25 05:09

Stan Barrows


2 Answers

The "PHP Executable" path in PhpStorm is not for the configuration directory, it's for the "php" binary itself.

Running which php on your terminal should reveal the linked interpreter path.

It's probably something like /opt/homebrew/bin/php.

like image 185
istepaniuk Avatar answered Sep 12 '25 20:09

istepaniuk


the php executable path is in /opt/homebrew/Cellar/php/8.1.7/bin/php

like image 25
Felipe Reis Avatar answered Sep 12 '25 20:09

Felipe Reis