Install simplexml php 7.4 ubuntu

How To Install "php-simplexml" Package on Ubuntu

Quick Install Instructions of php-simplexml on Ubuntu Server. It’s Super Easy! simply click on Copy button to copy the command and paste into your command line terminal using built-in APT package manager.

See below for quick step by step instructions of SSH commands, Copy/Paste to avoid miss-spelling or accidently installing a different package.



Quick Install Steps:

Step 1

Step 2

sudo apt-get install -y php-simplexml

Step 3

Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on your servers and more. The apps run in docker containers, to learn more
see ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.

Execute the commands above step by step. You can simply hit the copy button to copy the command and paste into the command line interface.
Note: -y flag means to assume yes and silently install, without asking you questions in most cases.



Detailed Instructions:
Step 1

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

Step 2

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

sudo apt-get install -y php-simplexml

Step 3

Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on your servers and more. The apps run in docker containers, to learn more
see ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.

I'm testing PHP7, and have a weird issue after a recent update. SimpleXML should be enabled by default, and my phpinfo page shows that it is available:

Install simplexml php 7.4 ubuntu

However, the functions are not available:

\n";
} else {
    echo "simpleXML functions are not available.
\n"; } // result-- NOT available

And the module isn't listed as loaded:

~ $ php -m
[PHP Modules]
calendar
Core
ctype
curl
...
Reflection
session
shmop
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

Anyone know if there's a workaround for this?

Version info:

~ $ php -v
PHP 7.0.3-8+deb.sury.org~trusty+2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

asked Feb 24, 2016 at 4:51

user101289user101289

9,43415 gold badges74 silver badges138 bronze badges

4

I had the same problem and I'm using Ubuntu 15.10.

In my case, to solve this issue, I installed the package php7.0-xml using the Synaptic package manager, which include SimpleXml. So, after restart my Apache server, my problem was solved. This package came in the Debian version and you can find it here: https://packages.debian.org/sid/php7.0-xml.

Install simplexml php 7.4 ubuntu

Tieme

60.2k19 gold badges99 silver badges154 bronze badges

answered Feb 24, 2016 at 13:56

Install simplexml php 7.4 ubuntu

8

For all those using Ubuntu with ppa:ondrej/php PPA this will fix the problem:

apt install php7.0-mbstring php7.0-zip php7.0-xml

(see https://launchpad.net/~ondrej/+archive/ubuntu/php)

Thanks @Alexandre Barbosa for pointing this out!

EDIT 20160423:

One-liner to fix this issue:

sudo add-apt-repository -y ppa:ondrej/php && sudo apt update && sudo apt install -y php7.0-mbstring php7.0-zip php7.0-xml

(this will add the ppa noted above and will also make sure you always have the latest php. We use Ondřej's PHP ppa for almost two years now and it's working like charm)

answered Feb 24, 2016 at 22:34

Install simplexml php 7.4 ubuntu

FlatronFlatron

1,3251 gold badge12 silver badges33 bronze badges

1

For Ubuntu 14.04 with

PHP 7.0.13-1+deb.sury.org~trusty+1 (cli) ( NTS )

sudo apt-get install php-xml

worked for me.

answered Nov 29, 2016 at 5:11

Install simplexml php 7.4 ubuntu

Deepak RDeepak R

4058 silver badges9 bronze badges

0

For Alpine (in docker), you can use apk add php7-simplexml.

If that doesn't work for you, you can run apk add --no-cache php7-simplexml. This is in case you aren't updating the package index first.

answered Aug 8, 2017 at 19:02

brismuthbrismuth

33.7k3 gold badges34 silver badges37 bronze badges

5

I'm using Bash on Windows (Ubuntu 16.04) and I just installed with php7.0-xml and all is working now for the Symfony 3.2.7 PHP requirements.

sudo apt-get install php7.0-xml

answered Apr 19, 2017 at 19:43

WebLukeWebLuke

1561 silver badge5 bronze badges

0

------------------in centos-------------------------

find out which package provides php-xml:

 yum provides php-xml

then from the output list,select the appropriate one, install

yum install php70u-xml-7.0.14-2.ius.centos7.x86_64

answered Jan 9, 2017 at 8:09

terwxqianterwxqian

5365 silver badges6 bronze badges

1

Because Google led me here, on Ubuntu 20.04 this works in 2020:

sudo apt install php7.4-xml

If on Apache2, remember to restart (probably not necessary):

sudo systemctl restart apache2

answered Jun 28, 2020 at 0:48

Install simplexml php 7.4 ubuntu

RustyNoxRustyNox

3755 silver badges7 bronze badges

1

Had the same problem on AWS Linux 2, phpinfo() shows SimpleXML installed but not working, below cmd solved my issue

sudo yum install php-xml

answered Nov 21, 2018 at 12:01

Install simplexml php 7.4 ubuntu

BluePBlueP

4877 silver badges8 bronze badges

0

For Ubuntu 18.04 and php7.3, install php7.3-xml

    sudo apt-get install php7.3-xml

this will installl the required simplexml

answered Dec 28, 2020 at 12:27

Typically on Debian systems you have different PHP configuration for CLI and for PHP running as say an Apache module. Your phpinfo page may very well show simplexml as being enabled via web server, while it is not enabled via CLI.

answered Feb 24, 2016 at 5:12

Install simplexml php 7.4 ubuntu

Mike BrantMike Brant

69.5k10 gold badges97 silver badges102 bronze badges

1

my experience

  1. get your php version

    php --version

  2. Instal package for your php version

    sudo apt-get install php7.4-xml

  3. Restart apache

    sudo systemctl reload apache2

answered Jan 3, 2021 at 16:54

elfTineelfTine

3012 silver badges5 bronze badges

in my case, you have to make sure about your php version.

php -v

example: if your php is PHP 7.4.28, than you have to write

sudo apt install php7.4-xml

see, instead to write all version, just write the first and second, than following with -xml

I have this issue and it's take time, until I understand how to write properly. hopefully it's work for you

answered Mar 10 at 5:56

Install simplexml php 7.4 ubuntu

ahmahm

1091 silver badge8 bronze badges