Home > Net >  Can't run composer on Mac - env: php: No such file or directory
Can't run composer on Mac - env: php: No such file or directory

Time:10-30

I updated my Mac os to the latest version (Monterey 12.0.1) and now I cannot run composer. I'm using XAMPP.

I'm trying to run a composer command on a Laravel installation and get this error:

env: php: No such file or directory

How can I fix this?

CodePudding user response:

You need to add php to the PATH Variable

1- Run sudo nano ~/.bash_profile

2- add this export XAMPP_HOME=/Applications/XAMPP export PATH=${XAMPP_HOME}/bin:${PATH} export PATH at the top of the file

3- save the file press CTRL O then CTRL X

CodePudding user response:

I had to upgrade composer. It seems that the os update messed up something

  • Related