phppowershellubuntupackage

I am missing simplexml on my ubuntu machine but I can't download it


so I get the following error while installing Pterodactyl panel:

Problem 1
- Installation request for aws/aws-sdk-php ^3.156 -> satisfiable by aws/aws-sdk-php[3.156.0].
- aws/aws-sdk-php 3.156.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.



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

but then when doing sudo apt-get install -y php-simplexml

it gives me this:

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php-simplexml is a virtual package provided by:
  php7.4-xml 7.4.10-1+ubuntu20.04.1+deb.sury.org+1
  php7.3-xml 7.3.22-1+ubuntu20.04.1+deb.sury.org+1
  php7.2-xml 7.2.33-1+ubuntu20.04.1+deb.sury.org+1
  php7.1-xml 7.1.33-17+ubuntu20.04.1+deb.sury.org+1
  php7.0-xml 7.0.33-30+ubuntu20.04.1+deb.sury.org+1
  php5.6-xml 5.6.40-30+ubuntu20.04.1+deb.sury.org+1
You should explicitly select one to install.

E: Package 'php-simplexml' has no installation candidate

what can I do?

I'm new to ubuntu and have no clue of what to do


Solution

  • As error says, You should explicitly select one to install.

    Search for php version on your machine by

    php --version
    

    then use that version to install the package

    sudo apt-get install -y  php<version>-xml
    
    # so if you get 7.4 then it would be
    sudo apt-get install -y  php7.4-xml
    

    Thanks to @bassxzero for noticing php version.