Ad

Composer Install Fail Digitalocean Web Hosting

What I did:

  1. SSH Setuped
  2. Php7.2 installed
  3. apache2 installed
  4. Pull Files from GitLab

When I run this apt install Composer

[email protected]:~/sewa# apt install composer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
composer is already the newest version (1.6.3-1).
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

but I can't install composer when I run composer install there is coming error message like this

[email protected]:~/sewa# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for dompdf/dompdf v0.8.5 -> satisfiable by dompdf/dompdf[v0.8.5].
    - dompdf/dompdf v0.8.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 2
    - Installation request for laravel/framework v6.18.2 -> satisfiable by laravel/framework[v6.18.2].
    - laravel/framework v6.18.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - Installation request for league/commonmark 1.3.1 -> satisfiable by league/commonmark[1.3.1].
    - league/commonmark 1.3.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 4
    - Installation request for tijsverkoyen/css-to-inline-styles 2.2.2 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.2].
    - tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 5
    - Installation request for facade/ignition 1.16.1 -> satisfiable by facade/ignition[1.16.1].
    - facade/ignition 1.16.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 6
    - Installation request for phar-io/manifest 1.0.3 -> satisfiable by phar-io/manifest[1.0.3].
    - phar-io/manifest 1.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 7
    - Installation request for phpunit/php-code-coverage 7.0.10 -> satisfiable by phpunit/php-code-coverage[7.0.10].
    - phpunit/php-code-coverage 7.0.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 8
    - Installation request for phpunit/phpunit 8.5.2 -> satisfiable by phpunit/phpunit[8.5.2].
    - phpunit/phpunit 8.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 9
    - Installation request for scrivo/highlight.php v9.18.1.1 -> satisfiable by scrivo/highlight.php[v9.18.1.1].
    - scrivo/highlight.php v9.18.1.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 10
    - Installation request for theseer/tokenizer 1.1.3 -> satisfiable by theseer/tokenizer[1.1.3].
    - theseer/tokenizer 1.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 11
    - dompdf/dompdf v0.8.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - barryvdh/laravel-dompdf v0.8.6 requires dompdf/dompdf ^0.8 -> satisfiable by dompdf/dompdf[v0.8.5].
    - Installation request for barryvdh/laravel-dompdf v0.8.6 -> satisfiable by barryvdh/laravel-dompdf[v0.8.6].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.2/cli/php.ini
    - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.2/cli/conf.d/10-opcache.ini
    - /etc/php/7.2/cli/conf.d/10-pdo.ini
    - /etc/php/7.2/cli/conf.d/20-apcu.ini
    - /etc/php/7.2/cli/conf.d/20-apcu_bc.ini
    - /etc/php/7.2/cli/conf.d/20-calendar.ini
    - /etc/php/7.2/cli/conf.d/20-ctype.ini
    - /etc/php/7.2/cli/conf.d/20-exif.ini
    - /etc/php/7.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.2/cli/conf.d/20-ftp.ini
    - /etc/php/7.2/cli/conf.d/20-gd.ini
    - /etc/php/7.2/cli/conf.d/20-gettext.ini
    - /etc/php/7.2/cli/conf.d/20-iconv.ini
    - /etc/php/7.2/cli/conf.d/20-json.ini
    - /etc/php/7.2/cli/conf.d/20-mysqli.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.2/cli/conf.d/20-phar.ini
    - /etc/php/7.2/cli/conf.d/20-posix.ini
    - /etc/php/7.2/cli/conf.d/20-readline.ini
    - /etc/php/7.2/cli/conf.d/20-shmop.ini
    - /etc/php/7.2/cli/conf.d/20-sockets.ini
    - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.2/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

What I want to do solve this error

Ad

Answer

install the following php extensions -

php7.2-mbstring php7.2-dom

Run the following command to install them -

sudo apt install php7.2-mbstring php7.2-dom

then restart the apache -

sudo systemctl reload apache2
Ad
source: stackoverflow.com
Ad