How do I uninstall `php` that's not found in `yum list` or `rpm -qa`?

7,998

Solution 1

This works for me:

$ find / -name php -type f -executable 2>/dev/null
/usr/bin/php

(might need to get some coffee while it runs).

Solution 2

It may be that only the apache php module was installed and not the commandline interpreter. You disable the module by not loading it in your httpd.conf (or the config includes).

The alternative to installing from package is either copying binaries or compiling from source.

With a bit of luck the sources remain and you could try if the Makefile file has an uninstall section and make uninstall works.

If not then simply deleting by hand is the only way to remove the software. The makefile may contain some hints on where components were installed.

Share:
7,998

Related videos on Youtube

Ryan
Author by

Ryan

Updated on September 18, 2022

Comments

  • Ryan
    Ryan over 1 year

    I have a rogue php install somewhere on my server that I'd like to remove and stick with pure yum installs.

    How can I find and uninstall this rogue php install?

    yum and rpm searches both come up empty.

    $ yum list installed | grep -i php
    $ rpm -qa | grep -i php
    $ php -v
    -bash: /usr/bin/php: No such file or directory
    

    And yet the browser can return a simple <?php phpinfo(); ?> page.

    • jirib
      jirib over 10 years
      Is it so hard to check web server configuration to find out what is it doing when a request for php file is done? Check all writable directories by www or www-data user (/var/tmp, /tmp, /home ...??).