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

Detect Homebrew-installed PHP #160

Closed
wants to merge 1 commit into from
Closed

Detect Homebrew-installed PHP #160

wants to merge 1 commit into from

Conversation

vitorgalvao
Copy link

With the removal of PHP in macOS 12, this Workflow no longer works out of the box. By using export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" before calling php, we return that experience to people who installed PHP via Homebrew. The two paths are Homebrew’s default install locations on Apple Silicon and Intel, respectively.

@jeffbyrnes
Copy link
Collaborator

@vitorgalvao this isn’t necessary; Alfred was modified by its owners/maintainers to know about Homebrew-installed PHP internally. You can learn a bit more in this Oct 2021 blog post.

@jeffbyrnes jeffbyrnes closed this Mar 20, 2022
@vitorgalvao
Copy link
Author

You’re misunderstanding the fix. What the Alfred update does is look for Homebrew-installed PHP in the language dropdown. So it goes from

image

to

image

But what you’re doing is calling php from inside /bin/bash. Alfred won’t modify your code and change the path to PHP there. If you’re calling the scripts from Bash or Zsh, you have to either use the full path to PHP or edit your PATH. Understanding the scripting environment goes into more detail.

The oversight in the Workflow is not hypothetical.

@jeffbyrnes
Copy link
Collaborator

🤦🏻‍♂️

Thanks for the patient reply, I had forgotten how this particular workflow is written.

Reopening, and I'll see if I can find some cycles this week to get this sorted!

@eduwass
Copy link

eduwass commented Jun 4, 2022

Some initial context: M1 MBP, I am running PHP from homebrew.

@jeffbyrnes for some reason when downloading the latest release file from the link in README:
https://github.com/willfarrell/alfred-pkgman-workflow/releases/latest/download/Package.Managers.alfredworkflow

... the fix that you applied here is not present (PATH in info.plist was empty).

So it threw the error mentioned here: #160

@jeffbyrnes
Copy link
Collaborator

@eduwass hmm. Ok, I’ll see about fixing that up.

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

Successfully merging this pull request may close these issues.

/bin/bash: php: command not found MacOS 12 doesn't work.
3 participants