php installation showing dpkg error

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

while installing php with command

sudo apt install php libapache2-mod-php php-mysql

The terminal showed :

genius@genius:~$ sudo apt install php libapache2-mod-php php-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.2 php7.2 php7.2-cli php7.2-common php7.2-json
  php7.2-mysql php7.2-opcache php7.2-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php libapache2-mod-php7.2 php php-mysql php7.2 php7.2-cli
  php7.2-common php7.2-json php7.2-mysql php7.2-opcache php7.2-readline
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,963 kB of archives.
After this operation, 17.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-common amd64 7.2.10-0ubuntu0.18.04.1 [878 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-json amd64 7.2.10-0ubuntu0.18.04.1 [18.8 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-opcache amd64 7.2.10-0ubuntu0.18.04.1 [165 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-readline amd64 7.2.10-0ubuntu0.18.04.1 [12.1 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-cli amd64 7.2.10-0ubuntu0.18.04.1 [1,405 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libapache2-mod-php7.2 amd64 7.2.10-0ubuntu0.18.04.1 [1,349 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libapache2-mod-php all 1:7.2+60ubuntu1 [3,212 B]
Get:8 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2 all 7.2.10-0ubuntu0.18.04.1 [9,248 B]
Get:9 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 php all 1:7.2+60ubuntu1 [3,084 B]
Get:10 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-mysql amd64 7.2.10-0ubuntu0.18.04.1 [118 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 php-mysql all 1:7.2+60ubuntu1 [2,004 B]
Fetched 3,963 kB in 6s (623 kB/s)                                              
Selecting previously unselected package php7.2-common.
(Reading database ... 257900 files and directories currently installed.)
Preparing to unpack .../00-php7.2-common_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-common (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-json.
Preparing to unpack .../01-php7.2-json_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-json (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-opcache.
Preparing to unpack .../02-php7.2-opcache_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-opcache (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-readline.
Preparing to unpack .../03-php7.2-readline_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-readline (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-cli.
Preparing to unpack .../04-php7.2-cli_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-cli (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php7.2.
Preparing to unpack .../05-libapache2-mod-php7.2_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libapache2-mod-php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php.
Preparing to unpack .../06-libapache2-mod-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking libapache2-mod-php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2.
Preparing to unpack .../07-php7.2_7.2.10-0ubuntu0.18.04.1_all.deb ...
Unpacking php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php.
Preparing to unpack .../08-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2-mysql.
Preparing to unpack .../09-php7.2-mysql_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-mysql (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../10-php-mysql_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-mysql (1:7.2+60ubuntu1) ...
Setting up php7.2-common (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/calendar.ini with new version

Creating config file /etc/php/7.2/mods-available/ctype.ini with new version

Creating config file /etc/php/7.2/mods-available/exif.ini with new version

Creating config file /etc/php/7.2/mods-available/fileinfo.ini with new version

Creating config file /etc/php/7.2/mods-available/ftp.ini with new version

Creating config file /etc/php/7.2/mods-available/gettext.ini with new version

Creating config file /etc/php/7.2/mods-available/iconv.ini with new version

Creating config file /etc/php/7.2/mods-available/pdo.ini with new version

Creating config file /etc/php/7.2/mods-available/phar.ini with new version

Creating config file /etc/php/7.2/mods-available/posix.ini with new version

Creating config file /etc/php/7.2/mods-available/shmop.ini with new version

Creating config file /etc/php/7.2/mods-available/sockets.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvsem.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvshm.ini with new version

Creating config file /etc/php/7.2/mods-available/tokenizer.ini with new version
Setting up php7.2-readline (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/readline.ini with new version
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up php7.2-json (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/json.ini with new version
Setting up php7.2-opcache (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/opcache.ini with new version
Setting up php7.2-mysql (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.2/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.2/mods-available/pdo_mysql.ini with new version
Setting up php7.2-cli (7.2.10-0ubuntu0.18.04.1) ...
update-alternatives: using /usr/bin/php7.2 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.2 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.2 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/7.2/cli/php.ini with new version
Setting up libapache2-mod-php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
Setting up php-mysql (1:7.2+60ubuntu1) ...
dpkg: dependency problems prevent configuration of libapache2-mod-php:
 libapache2-mod-php depends on libapache2-mod-php7.2; however:
  Package libapache2-mod-php7.2 is not configured yet.

dpkg: error processing package libapache2-mod-php (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.2:
 php7.2 depends on libapache2-mod-php7.2 | php7.2-fpm | php7.2-cgi; however:
  Package libapache2-mod-php7.2 is not configured yet.
  Package php7.2-fpm is not installed.
  Package php7.2-cgi is not installed.

dpkg: error processing package php7.2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php:
 php depends on php7.2; however:
  Package php7.2 is not configured yet.

dpkg: error processing package php (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    No apport report written because MaxReports is reached already
                                  Errors were encountered while processing:
 libapache2-mod-php7.2
 libapache2-mod-php
 php7.2
 php
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to reinstall but same output. Please help me fix this and properly install php.

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community