How do I reinstall PHP on my system?

43,420

Solution 1

If you want to change the ./configure options if a package, you need to rebuild the package. The easiest way to do this is run:

# apt-get install build-essential devscripts
# apt-get source php5
# cd php5-*
# vim debian/rules 
# debuild -us -uc -b

You should now find the rebuild packages in the directory above the source. You can install these using "dpkg -i php5_1.2.3-4_amd64.deb" where the filename is the list of packages you want to install.

Solution 2

dpkg -l | grep php5

If you want to make sure that PHP is utterly purged;

apt-get remove --purge php5-common

Instructions to reinstall vary whether you're using mod_php5 or a CGI-based effort, there is also a CLI version, see 'apt-cache search php5' for a complete list of modules and bits.

You cannot supply ./configure arguments using Aptitude. What module are you missing and does it show up in 'apt-cache search php5-'? :) Most of them probably do!

You should just need to;

apt-get install libapache2-mod-php5

That'll pull in all the dependencies, then just restart Apache. You'll not be able to use your external PCRE library, but what does that give you over the packaged stuff from your distribution?

Solution 3

How do you detect that php is still installed ? If php web pages continue to work, you need to remove libapache2-mod-php5 package.

List all installed php packages

aptitude search php|grep "^i"

If you find out that no package is installed, a manual php installation may have been performed. Look for its installation location with "locate php", and remove it.

Share:
43,420

Related videos on Youtube

Tony
Author by

Tony

Updated on September 17, 2022

Comments

  • Tony
    Tony almost 2 years

    I did sudo aptitude --purge remove php5, which removed successfully, except php5 is still installed on my system. How can I uninstall and re-install php5?

    UPDATE

    Thanks for the answers, I have these packages installed:

    tony@bandop $ aptitude search php|grep "^i"
    i A libapache2-mod-php5             - server-side, HTML-embedded scripting langu
    i   php-pear                        - PEAR - PHP Extension and Application Repos
    i   php5-cli                        - command-line interpreter for the php5 scri
    i A php5-common                     - Common files for packages built from the p
    i   php5-dev                        - Files for PHP5 module development         
    i   php5-mysql                      - MySQL module for php5 
    

    I want to configure PHP to use a external PCRE library that I built. Do you know which package I have to reconfigure? Is there a way to specify config options when installing a package with aptitude?

  • Tony
    Tony almost 15 years
    i updated the question. i have uninstalled successfully. now i need to know how to reinstall. i would love to use aptitude but i can't find any documentation telling me how to set "./configure" options.
  • nixgeek
    nixgeek almost 15 years
    Updated the post to reflect your changes