Install php7.2-xml on nginx without apache - php

I am trying to install php7.2-xml for my LEMP with nginx but the problem of libapache2-mod-php7.2 is appearing. Strange that it is connected to apache while I use no apache but nginx. Anyway I cannot install the extension. How to install php7.2-xml?
mann#debian:~/Dropbox/deploy$ sudo apt-get install php7.2-xml
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.2-xml is already the newest version (7.2.8-2).
The following packages were automatically installed and are no longer required:
libargon2-0 libc-ares2 libhttp-parser2.7.1 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1571 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libapache2-mod-php7.2 (7.2.8-2) ...
dpkg: error processing package libapache2-mod-php7.2 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
mann#debian:~/Dropbox/deploy$

Related

Why is showes error processing package mysql-server-8.0 (--configure)?

I'm new at PHP Laravel and I'm setting up Laravel by downloading the packages and Xampp in Lubuntu. When I download mysql by runing the command: sudo apt install mysql-server it shows me an error:
^[ORdpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (245.4-4ubuntu3.11) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have also tried to remove the mysql, upgrade and update sudo apt install and to install it again but still shows the same error.
Hope to help you
sudo apt-get clean
sudo apt-get purge 'mysql*'
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-8.0
sudo apt-get dist-upgrade

Issue installing mysql-server-5.6 on Ubuntu 16.04

I am getting this error message when I try to install mysql-server-5.6: sudo apt-get install mysql-server-5.6:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.6
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 0 B/6,004 kB of archives.
After this operation, 52.7 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 75769 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb ...
Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
mysql-client-5.6 were installed normally.
I first, uninstalled mysql-server-5.7:
sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
I added repos using this 2 methods:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
and
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
Notice that I also installed PHP 5.6 without any problem.
Since all my project depend on MCRYPT, I have to install this version in order to it to works well.
I used mysql-server-5.7 but it is not compatible ... datas are not inserted into mysql server.
Your help is needed, thank you in advance.
I think the issue is with the mysql client, because you already have it and it is trying to install it, which is causing the error.
Run this command to cleanup unused libraries:
sudo apt-get autoremove
and then try to install it again

E: Sub-process /usr/bin/dpkg returned an error code (1)

While trying to uninstall php7.0, I got the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php7.0' is not installed, so not removed
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-92 linux-headers-4.4.0-92-generic linux-headers-4.4.0-93 linux-headers-4.4.0-93-generic linux-headers-4.4.0-96
linux-headers-4.4.0-96-generic linux-image-4.4.0-92-generic linux-image-4.4.0-93-generic linux-image-4.4.0-96-generic
linux-image-extra-4.4.0-92-generic linux-image-extra-4.4.0-93-generic linux-image-extra-4.4.0-96-generic
linux-signed-image-4.4.0-92-generic linux-signed-image-4.4.0-93-generic linux-signed-image-4.4.0-96-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up libapache2-mod-php7.0 (7.0.22-0ubuntu0.16.04.1) ...
dpkg: error processing package libapache2-mod-php7.0 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of libapache2-mod-php:
libapache2-mod-php depends on libapache2-mod-php7.0; however:
Package libapache2-mod-php7.0 is not configured yet.
dpkg: error processing package libapache2-mod-php (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libapache2-mod-php7.0
libapache2-mod-php
E: Sub-process /usr/bin/dpkg returned an error code (1)
I used the following command:
sudo apt-get remove php7.0
I searched the whole internet and tried all the solutions but did not got the right solution.
This is mostly because some package or dependency got stuck in package manager.
Try the following commands (with sudo):
apt-get purge
apt-get --autoremove
apt-get --autoclean
Then try uninstalling php7.0 using the following command:
apt-get --purge remove php7.0

Error while trying to install php module for apache2

Initially the problem was PHP files on my server were displayed as plain text(the whole code was shown). So I found out by investigating that the MIME type has to be added to the /etc/mime.types , so I did that and also restarted my server but that didn't help solve the issue so on further investigation, I found out from here that we needed php5 module enabled and on running the apachectl -M, I couldn't find the php5 module listed. So I tried installing it and this was the outcome of it :
admin#vm:~$ sudo apt-get install php5
...
php5_invoke pdo: already enabled for apache2 SAPI
dpkg: error processing package libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
admin#vm:~$ sudo apt-get install libapache2-mod-php5
...
dpkg: error processing package libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also need to mention that I created 2 virtual hosts for the sites. I am not sure what is wrong. Could some one help me on this?
This is not a proper solution but I re-installed Apache and it worked fine:
$ sudo apt-get purge apache2
$ sudo apt-get purge php5 libapache2-mod-php5
$ sudo apt-get purge autoremove
$ sudo apt-get install apache2 libapache2-mod-php5 php5
the package libapache2-mod-php5 comprise libphp5.so which locates at /usr/lib/apache2/modules, and php5.conf/php5.load which locate at /etc/apache2/mods-availables.
thus you could get the three files, and copy to corresponding position.
And, you should link, using ln -s, php5.conf/load to /etc/apache2/mods-enables, thus apached could find the configuration file and load the libphp5.so.
I got the same problem and resolve it

Errors were encountered while processing: libapache2-mod-php5 php5 php5-cli

I am using Ubuntu 11.10 now. When I struggled to install php5 by typing
sudo apt-get install php5
I got this error:
......
Errors were encountered while processing:
libapache2-mod-php5
php5
php5-cli
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried to do it again, but just got the same error. Then someone suggest me to remove it. I did:
sudo apt-get remove --purge php5
and got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
php5*
0 upgraded, 0 newly installed, 1 to remove and 27 not upgraded.
3 not fully installed or removed.
After this operation, 20.5 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ...
dpkg: warning: files list file for package `firefox-locale-en' missing, assuming package has no files currently installed.
(Reading database ... 161883 files and directories currently installed.)
Removing php5 ...
Setting up libapache2-mod-php5 (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up php5-cli (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing php5-cli (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
php5-cli
Then I tried to install just php5-cli and got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-cli is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up libapache2-mod-php5 (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5:
php5 depends on libapache2-mod-php5 (>= 5.3.6-13ubuntu3.8) | libapache2-mod-php5filter (>= 5.3.6-13ubuntu3.8) | php5-cgi (>= 5.3.6-13ubuntu3.8) | php5-fpm (>= 5.3.6-13ubuntu3.8); however:
Package libapache2-mod-php5 is not configured yet.
Package libapache2-mod-php5filter is not installed.
Package php5-cgi is not installed.
Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
dependency problems - leaving unconfigured
Setting up php5-cli (5.3.6-13ubuntu3.8) ...
No apport report written because the error message indicates its a followup error from a previous failure.
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing php5-cli (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
php5
php5-cli
E: Sub-process /usr/bin/dpkg returned an error code (1)
I can't open php5-cli though. What's wrong and what should I do?
Open terminal and type
sudo apt-get install -f

Categories