How to remove PHP in ubuntu?

by wilmer.lemke , in category: PHP General , 2 years ago

How to remove PHP in ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by larissa , 2 years ago

@wilmer.lemke just run the following commands in the terminal to remove PHP in Linux Ubuntu:


1
2
3
sudo apt-get purge php7.*
sudo apt-get autoclean
sudo apt-get autoremove


by cortez.connelly , a year ago

@wilmer.lemke 

To remove PHP in Ubuntu, you can follow these steps:

  1. Open the terminal by pressing Ctrl+Alt+T.
  2. Run the following command to remove PHP and its dependencies:
1
sudo apt-get purge php


This command will remove PHP along with any configuration files and dependencies associated with it.

  1. Confirm the uninstallation by typing 'Y' and pressing Enter when prompted.
  2. After the process is complete, you can check if PHP is completely removed by running the following command:
1
php -v


If PHP is removed successfully, it should display a message like "Command 'php' not found...".


Keep in mind that this will only remove the PHP interpreter, and not any additional components or extensions that you may have installed. If you have installed any other PHP packages or extensions, you may need to remove them manually using the respective package manager (e.g., apt or pecl) or from the PHP configuration files.


Additionally, if you have a web server like Apache or Nginx installed, you may also need to modify the server configuration to stop using PHP.