How can I uninstall PHP 5.4 and 5.5?

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I'm new to PHP and Apache and I think I've messed some things up that I don't know how to fix. After following a tutorial I managed to update to PHP 5.5, and then started having problems. I went to downgrade to PHP 5.4, but then I had more problems, so I tried to re-update to PHP 5.5 and now it's saying it's already installed. However, when I reload my my_phpinfo.php (localhost address) in Firefox, it only shows that I'm running PHP version 5.3.15 which is what I started out with originally.

Can someone give me step by step instructions on how to go in and delete all the PHP 5.4 and 5.5 files I've updated so I can just start over with a clean slate and re-download PHP 5.5 and start again?

profilepic.png
manpreet 2 years ago

 

I'm assuming that the deployment/install script was put at /usr/local/packager/packager.py when it was installed. Apparently, you can use this script to list the packages that are installed:

/usr/local/packager/packager.py list

Unfortunately, the script that you used to install PHP doesn't appear to have an uninstall feature. However, you should be able to remove the installed content that was installed from /usr/local. It is probably a good idea to examine the contents of the /usr/local directory first to confirm the contents:

ls -al /usr/local

From what I can see, the script is installing the software with prefixes like "php5-*", and is linking to the 'current' version of that software using a symbolic link named "php5". The commands below will unlink the symlink, and remove the installed versions of PHP that were installed using the script mentioned above:

sudo unlink /usr/local/php5
sudo rm -rf /usr/local/php5-*

To remove the supplemental configuration file that was installed with the updated PHP software, you may be able to remove the config file at /etc/apache2/other/+php-osx.conf:

sudo rm -rf /etc/apache2/other/+php-osx.conf

Then restart Apache:

sudo apachectl restart

Note: the /usr/local folder shouldn't have much inside of it unless you've installed 3rd party software there. You may find a few PHP installs there that have names like "php5-5.3.x...", "php5-5.4.x...", and "php5-5.5.x...". The rm command above should remove any variants of this naming scheme. Removing the additional Apache configuration file should allow Apache to start normally after the module has been removed.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.