WARNING: Module ini file doesn't exist under /etc/php/7.0/mods-available
Asked Answered
I

4

26

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):

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
Indented answered 9/6, 2016 at 5:0 Comment(0)
I
17

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.

Indented answered 9/6, 2016 at 7:17 Comment(0)
C
44

I came here because I had trouble installing Phpmyadmin on Ubuntu after upgrading from php 7.0 to 7.1

Here is the trick

  1. remove php version (7.0 for instance - adapt the command line)

    sudo apt-get purge php7.0-common

Note --> You should check the list of packages that will be removed.

  1. Install php modules

    sudo apt-get install php7.1-mbstring sudo apt-get install php7.1-mcrypt ...

  2. activate the modules

    sudo phpenmod mbstring sudo phpenmod mcrypt

(option for apache) activate php7.1

sudo a2enmod php7.1

And of course restart your server (apache in this case)

sudo systemctl restart apache2
Carnation answered 5/6, 2017 at 15:54 Comment(1)
I don't think ppa-purge is actually required. purge is a command of APT itself, while ppa-purge is something different.Nobility
I
17

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.

Indented answered 9/6, 2016 at 7:17 Comment(0)
C
6

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

I'm using Ubuntu 18.04, just installed 1 our ago.

Claribelclarice answered 7/9, 2019 at 12:45 Comment(0)
G
0

Step 1 Run update command to update package repositories and get latest package information.

sudo apt-get update -y

Step 2 Run the install command with -y flag to quickly install the packages and dependencies.

sudo apt-get install -y php-mysqli

Greyback answered 30/6, 2021 at 8:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.