How to completely remove PHPBrew and reinstall regular PHP

让人想犯罪 __ 提交于 2019-12-24 11:56:03

问题


I used PHPBrew for a while and now want to remove it completely for various reasons.

How do I do that? Removing the ~/.phpbrew directory only is not sufficient.

Even removing and reinstalling all PHP packages is not enough, since Apache still somehow loads the allegedly removed PHPBrew module:

Loaded Configuration File => ~/.phpbrew/php/php-5.6.30/etc/php.ini

回答1:


To switch between PHP5 and PHP7 in Apache, it is necessary for PHPBrew to enable & dissable custom apache modules. These need to be removed as well. Depending on the existing permissions it is not possible to just reinstall the apache module. Thats why they are still loaeded & running, even if the PHPBrew folder and PHP itself is already removed.

The following commands removed all PHPBrew files and reinstalled regular PHP on my system.

### remove phpbrew
rm -rf ~/.phpbrew/
rm -rf /usr/local/bin/phpbrew
vim ~/.bashrc #remove phpbrew settings

### either edit modules, or remove completely
sudo rm -rf /etc/apache2/mods-enabled/php*
sudo rm -rf /etc/apache2/mods-available/php*
sudo rm -rf /usr/lib/apache2/modules/libphp*

### reinstall php
#dpkg -l | grep php
#sudo apt-get remove --purge php*
sudo apt-get install --reinstall php php-common libapache2-mod-php


来源:https://stackoverflow.com/questions/44655608/how-to-completely-remove-phpbrew-and-reinstall-regular-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!