Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/bin/bash: php: command not found #159

Closed
carter-lavering opened this issue Mar 14, 2022 · 4 comments
Closed

/bin/bash: php: command not found #159

carter-lavering opened this issue Mar 14, 2022 · 4 comments

Comments

@carter-lavering
Copy link

This has gotta be something so basic that I am overlooking, as I'm somewhat unfamiliar with scripting and such. It seems like Alfred isn't able to read my PATH variable and figure out where php is. If I run php from a terminal window (either bash or zsh) it opens just fine, but trying to search any repo with this workflow immediately crashes:

[16:49:44.599] Package Managers[Script Filter] Queuing argument ''
[16:49:44.666] Package Managers[Script Filter] Script with argv '(null)' finished
[16:49:44.668] ERROR: Package Managers[Script Filter] Code 127: /bin/bash: php: command not found

Every repo I've tried throws an error identical to this. It seems like it might be a permissions issue, but Alfred has Automation and Full Disk Access permissions.

Sorry that this is somewhat off topic, I just wasn't sure where else to ask. Thanks!

@carter-lavering
Copy link
Author

Never mind! Found details in #158 that helped fix my issue, by adding a PATH workflow environment variable with /opt/homebrew/bin:$PATH. All is working now!

@carter-lavering
Copy link
Author

And through further trial and error (and reading) I have found that $PATH expansion is not supported, so even though search seemed to be working at first glance, nothing else was. I've replaced $PATH with /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin (again, per #158) and everything works now.

@jeffbyrnes
Copy link
Collaborator

@carter-lavering so yeah, Alfred’s owners/maintainers set it up so that Alfred uses its own internal logic (not $PATH) and if it finds PHP at one of the two locations Homebrew uses by default (/usr/local/bin on Intel Macs, /opt/local/bin on Apple Silicon Macs) it uses that location, otherwise it falls back to /usr/bin/php, the old location on pre-Monterey macOS.

@carter-lavering
Copy link
Author

carter-lavering commented Mar 15, 2022

I'm running Apple Silicon and my Homebrew installed to /usr/homebrew/bin (which, according to the Homebrew docs, is the default), but I guess I need to take that up with the Alfred devs and not here. Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants