A
A
Artem00712018-05-04 11:44:55
macOS
Artem0071, 2018-05-04 11:44:55

Did you press something and break everything?

Good afternoon!
I tried to update the PHP version on a Mac, but now I'm generally surprised that it (Mac) is still working ..
PHP version "5.6.30" was installed
But the devil pulled it to install 7.1
After a short search, an article was found in which there was the following line:

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1

But then the poppy began to swear:
Detected macOS Sierra 10.12. All ok.
Get packager.tgz
Unpack packager.tgz
Please type in your password, as we want to install this into /usr/local
Password:
tar: Error opening archive: Failed to open '/tmp/packager.tgz'
Start packager (may take some time) using /usr/bin/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/usr/local/packager/packager.py': [Errno 2] No such file or directory
Finished.

And in the same article it was said "if it doesn't help, then try this" (well, I tried it in the terminal (now I realized that this should have been done in .bashsrc)):
export PATH=”$(brew — prefix homebrew/php/php71)/bin:$PATH”

Mac gave me (I think this is due to text processing and there should have been 2 dashes):
Error: Unknown command: —
In general, after that, absolutely everything stopped working ..
-bash: brew: command not found
-bash: php: command not found
-bash: curl: command not found

As I understand it, the path to these (executable files?) is lost there.
Now I don’t understand how this can be fixed ..
Help pliz, otherwise I’m afraid to even turn it off now ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Pugachev, 2018-05-04
@Artem0071

I won’t tell you about this php installer,
but what happened next: you apparently broke the PATH environment variable, which is a list of paths along which bash will try to find executable files
if no commands work - this means that the paths to them are not in PATH variable
, that is, most likely you overwrote it with something strange , you
can check the contents of this variable like this:
echo $ PATH
, in theory, you can open another terminal and echo $ PATH there and compare the results,
I think they will differ
how to fix? two options
1) close the first terminal and all
those changes that you made exist only in that terminal session
in the new terminal everything will start from the beginning
2) copy the value of the PATH variable from the second terminal and do in the first one
export PATH=<all paths>
after that everything should return to normal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question