admin管理员组文章数量:1335404
I've successfully installed PHP 8.1 on my OSX Catalina computer using homebrew. I can see the new version is installed in /usr/local/opt/[email protected]
Various other SO posts indicate that to up update $PATH, I should do this:
export PATH=/usr/local/opt/[email protected] :$PATH
When I do that, I get the error "`:/usr/local/opt/[email protected]': not a valid identifier", not sure where the ":" before the filepath came from.
I thin the export command only sets the php path for the current Terminal session and elsewhere on SO, I see I should add the same export command to my ~/.profile or ~/.bashrc file but neither of those files exist in my user directory (yes I am configured to see hidden files). Once the problem with the export command is resolved, should I simply create on of profile/bashrc files and add it export to the new file.
Thanks for any help, you can probably tell, I hardly everr use Terminal commands.
I've successfully installed PHP 8.1 on my OSX Catalina computer using homebrew. I can see the new version is installed in /usr/local/opt/[email protected]
Various other SO posts indicate that to up update $PATH, I should do this:
export PATH=/usr/local/opt/[email protected] :$PATH
When I do that, I get the error "`:/usr/local/opt/[email protected]': not a valid identifier", not sure where the ":" before the filepath came from.
I thin the export command only sets the php path for the current Terminal session and elsewhere on SO, I see I should add the same export command to my ~/.profile or ~/.bashrc file but neither of those files exist in my user directory (yes I am configured to see hidden files). Once the problem with the export command is resolved, should I simply create on of profile/bashrc files and add it export to the new file.
Thanks for any help, you can probably tell, I hardly everr use Terminal commands.
Share Improve this question asked Nov 20, 2024 at 0:41 PetePete 4932 gold badges7 silver badges16 bronze badges1 Answer
Reset to default 0It looks like you have a space character between @8.1 and the following colon. If you take that out, the command should work for the current shell.
You are probably running zsh rather than bash, so look for a .zshrc file and try adding your export command there.
本文标签: macosHow to update PATH after installing PHP (OSX)Stack Overflow
版权声明:本文标题:macos - How to update $PATH after installing PHP (OSX) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742388498a2465518.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论