repair broken symlinks / reinstall php5

27,089

You can do it like that:

apt-get purge libapache2-mod-php5 php5 && \
    apt-get install libapache2-mod-php5 php5
Share:
27,089
Johannes Staehlin
Author by

Johannes Staehlin

Updated on March 22, 2020

Comments

  • Johannes Staehlin
    Johannes Staehlin about 4 years

    How the I repair broken symlinks? / Delete 'dead' files?

    Context: Since I messed up my php.ini configuration on one of my local testservers, I decided to re-installed the basic webserver stuff. (apache2, php5,..)

    Problem: After installation is /etc/apache2/php5/php.ini missing at all, /etc/apache2/php5/conf.d is a 'broken symlink', I think.

    Error: During installation: Not replacing deleted config file /etc/php5/apache2/php.ini

    So what's these 'broken symlinks'? I can find them using 'ls /dir', they are colored in red :) I tried "rm /etc/php5 -R -f"? But it doesn't work... And how should I get rid of the php.ini 'zombie-file'? All I want is a new php5 installation.

  • d-_-b
    d-_-b over 11 years
    THANK. YOU. So. MUCH ! I've tried everything on this site...your answer worked
  • arkoak
    arkoak over 7 years
    in my case I also needed to reinstall php-mysql , modified the command slightly to apt-get purge libapache2-mod-php5 php5 php-mysql && apt-get install libapache2-mod-php5 php5 php-mysql