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.