无法摆脱阻止安装 php8.0 的 php7.2
我面临着摆脱 php7.2.2 为我的机器上的 php8.0 铺平道路的挑战。我尝试了许多建议的解决方案,但仍然不明白为什么当我运行 php7.2.2 时仍然显示 php -v ,但在尝试清除特定的 php 版本时,找不到它。我什至尝试重新启动我的电脑,看看更改是否有效,但没有。请参阅下面所附的屏幕截图。
首先,我开始尝试使用以下命令删除 php7.2.2:- sudo apt-get --purge auto-remove php7.2.2
二、交互切换模式
sudo update-alternatives --config php
sudo update-alternatives --config phar sudo update-alternatives --config phar.phar
第三,我尝试了手动切换 从 PHP 7.2 开始 => PHP 8.0
系统上默认设置了 PHP 7.2,我不得不切换到 PHP 8.0。 阿帕奇:
$ sudo a2dismod php7.2 $ sudo a2enmod php8.0 $ sudo service apache2 restart
也尝试过,命令行:
$ sudo update-alternatives --set php /usr/bin/php8.0
$ sudo update-alternatives --set phar /usr/bin/phar8.0 $ sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0
I have a challenge in getting rid of php7.2.2 to pave way for php8.0 on my machine. I have tried to with a number of suggested solutions but still don't understand why php7.2.2 still shows up when i run php -v
yet on trying to purge that specific php version the, it's not found. I have even tried to restart my pc to see if the changes would be effective but not. Please see the screenshot attached below.
First, I started By trying to remove php7.2.2 using the following commands:-
sudo apt-get --purge auto-remove php7.2.2
Second, Interactive switching mode
sudo update-alternatives --config php
sudo update-alternatives --config phar
sudo update-alternatives --config phar.phar
Third, I tried Manual Switching
From PHP 7.2 => PHP 8.0
Default PHP 7.2 is set on the system and I had to switch to PHP 8.0.
Apache:
$ sudo a2dismod php7.2
$ sudo a2enmod php8.0
$ sudo service apache2 restart
Have also tried, Command Line:
$ sudo update-alternatives --set php /usr/bin/php8.0
$ sudo update-alternatives --set phar /usr/bin/phar8.0
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论