#cloud-config
apt_update: true
packages:
  - apache2
  - php-mysql
  - mysql-server
  - libapache2-mod-php7.0
  - php7.0-mcrypt
  - php7.0-gd
  - php7.0-curl
write_files:
  - path: /var/www/html/info.php
    content: |
      <?php
      phpinfo();
      ?>
runcmd:
  - sed -i -e "s/index.html index.cgi index.pl index.php/index.php index.html index.cgi index.pl/" /etc/apache2/mods-enabled/dir.conf
  - service apache2 restart
#cloud-config
apt_update: true
packages:
  - apache2
  - php-mysql
  - mysql-server
  - libapache2-mod-php7.0
  - php7.0-mcrypt
  - php7.0-gd
  - php7.0-curl
  - php7.0-xml
write_files:
  - path: /var/www/html/info.php
    content: |
      <?php
      phpinfo();
      ?>
runcmd:
  - sed -i -e "s/index.html index.cgi index.pl index.php/index.php index.html index.cgi index.pl/" /etc/apache2/mods-enabled/dir.conf
  - service apache2 restart

Install php7.0-xml - LAMP on Ubuntu 16.04
Install php7.0-xml - LAMP on Ubuntu 16.04