PHP7 : install ext-dom issue PHP7 : install ext-dom issue laravel laravel

PHP7 : install ext-dom issue


First of all, read the warning! It says do not run composer as root! Secondly, you're probably using Xammp on your local which has the required php libraries as default.

But in your server you're missing ext-dom. php-xml has all the related packages you need. So, you can simply install it by running:

sudo apt-get updatesudo apt install php-xml

Most likely you are missing mbstring too. If you get the error, install this package as well with:

sudo apt-get install php-mbstring

Then run:

composer updatecomposer require cviebrock/eloquent-sluggable


For whom want to install ext-dom on php 7.1 and up run this command:

sudo apt install php-xml


sudo apt install php-xml will work but the thing is it will download the plugin for the latest PHP version.

If your PHP version is not the latest, then you can add version in it:

# PHP 7.1sudo apt install php7.1-xml# PHP 7.2:sudo apt install php7.2-xml# PHP 7.3sudo apt install php7.3-xml# PHP 7.4sudo apt install php7.4-xml# PHP 8sudo apt install php-xml