简体   繁体   English

Mac完全卸载未从brew安装的php

[英]Mac completely uninstall php that was not installed from brew

I'm running Mac Catalina and want to remove the php version to downgrade to php7.2 possibly use brew from now on.我正在运行 Mac Catalina 并希望删除 php 版本以降级到 php7.2可能从现在开始使用 brew。

At the moment I have this.目前我有这个。

I don't care much about the error but want I want to achieve is removing completely remove 7.3.11 and then reinstall from brew.我不太关心错误,但我想要实现的是完全删除 7.3.11,然后从 brew 重新安装。 I can't find anything about replacing php that is not coming from brew.我找不到任何关于替换不是来自 brew 的 php 的信息。 Please help.请帮忙。

$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'php_imap.dll' (tried: /usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll), /usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731/php_imap.dll.so)) in Unknown on line 0
PHP 7.3.11 (cli) (built: Jun  5 2020 23:50:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies

I found myself how to do it.我发现自己该怎么做。 I was looking at my user folder while the .profile file was in the root folder.当 .profile 文件位于根文件夹中时,我正在查看我的用户文件夹。 Then I just put this inside:然后我把这个放在里面:

export PATH="/usr/local/opt/php@7.4/bin:$PATH"导出路径="/usr/local/opt/php@7.4/bin:$PATH"

If you want to change the php version see the versions you have in /usr/local/opt/ and change the .profile file.如果您想更改 php 版本,请查看您在 /usr/local/opt/ 中的版本并更改 .profile 文件。 Just reboot after the change.更改后重新启动即可。

I hope it will help somebody.我希望它会帮助某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM