警告:/etc/php/7.0/mods-available 下不存在模块 ini 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37717174/
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
WARNING: Module ini file doesn't exist under /etc/php/7.0/mods-available
提问by TheDevWay
I have uninstalled php7 and all its modules from ubuntu, and when I try to reinstall the modules, I get the following error for each php module, and although the module is installed, because of this error, it is not activated and I cannot use them. Is the any way to solve this issue ? the error for each module(when installing):
我已经从 ubuntu 卸载了 php7 及其所有模块,当我尝试重新安装模块时,每个 php 模块都会出现以下错误,虽然模块已安装,但由于此错误,它没有被激活,我无法使用他们。有没有办法解决这个问题?每个模块的错误(安装时):
Not replacing deleted config file /etc/php/7.0/mods-available/intl.ini
WARNING: Module [module name] ini file doesn't exist under /etc/php/7.0/mods-available
WARNING: Module [module name] ini file doesn't exist under /etc/php/7.0/mods-available
WARNING: Module [module name] ini file doesn't exist under /etc/php/7.0/mods-available
采纳答案by TheDevWay
The problem was because of deleting php with sudo apt-get remove [package]
and with this form, configuration files won't clean from computer and the next time you try to install the package, Ubuntu won't let the package configuration files to overwrite.
the solution is to delete the package completely with purge
and the autoremove
the package so that It will completely remove from the computer with its configuration files and the next time you try to install, the configuration files with be created.
问题是因为sudo apt-get remove [package]
使用这种形式删除 php ,配置文件不会从计算机中清除,下次尝试安装包时,Ubuntu 不会让包配置文件覆盖。解决方案是完全删除该软件包purge
和该autoremove
软件包,以便它会从计算机中完全删除其配置文件,并在下次尝试安装时创建配置文件。
回答by Kaizoku Gambare
I came here because I had trouble installing Phpmyadmin on Ubuntu after I upgrade from php 7.0 to 7.1
我来这里是因为我从 php 7.0 升级到 7.1 后在 Ubuntu 上安装 Phpmyadmin 时遇到问题
Here is the tricks
这是技巧
1) remove php version (7.0 for instance - adapt the command line)
1)删除php版本(例如7.0 - 调整命令行)
sudo apt-get purge php7.0-common
Note --> You should check the list of packaged that will be removed.
注意 --> 您应该检查将被删除的打包列表。
2) Install php modules
2)安装php模块
sudo apt-get install php7.1-mbstring
sudo apt-get install php7.1-mcrypt
...
3) activate the modules
3)激活模块
sudo phpenmod mbstring
sudo phpenmod mcrypt
(option for apache) activate php7.1
(apache 的选项)激活 php7.1
sudo a2enmod php7.1
And of course restart your server (apache in this case)
当然,重启你的服务器(在这种情况下是apache)
sudo systemctl restart apache2
回答by user2342558
For me, doing this single command solved the problem:
对我来说,做这个单一的命令解决了这个问题:
sudo apt install php7.0-mbstring
I noticed that sometimes (I don't know when and why) the module is called without the php version (e.g. sudo phpenmod mbstring) but php search it by the php's version in use (in my case is the 7.0.33).
我注意到有时(我不知道何时以及为什么)在没有 php 版本(例如 sudo phpenmod mbstring)的情况下调用模块,但是 php 会通过使用的 php 版本(在我的情况下是 7.0.33)来搜索它。
I'm using Ubuntu 18.04
, just installed 1 our ago.
我正在使用 Ubuntu 18.04
,我们之前刚刚安装了 1 个。