php 修复损坏的符号链接/重新安装 php5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9323678/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 06:34:15  来源:igfitidea点击:

repair broken symlinks / reinstall php5

phpapacheubuntuapache2symlink

提问by Johannes Staehlin

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,..)

上下文:由于我弄乱了本地测试服务器之一上的 php.ini 配置,因此我决定重新安装基本的 Web 服务器内容。(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.

问题:安装后根​​本没有 /etc/apache2/php5/php.ini,我认为 /etc/apache2/php5/conf.d 是一个“损坏的符号链接”。

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

错误:安装过程中: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.

那么这些“损坏的符号链接”是什么?我可以使用 'ls /dir' 找到它们,它们是红色的 :) 我试过“rm /etc/php5 -R -f”?但它不起作用......我应该如何摆脱 php.ini 'zombie-file'?我想要的只是一个新的 php5 安装。

回答by Roman Newaza

You can do it like that:

你可以这样做:

apt-get purge libapache2-mod-php5 php5 && \
    apt-get install libapache2-mod-php5 php5