PHP7 : install ext-dom issue

前端 未结 5 1732
情歌与酒
情歌与酒 2020-11-27 10:48

I\'m running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error:

pish@let:/ho         


        
5条回答
  •  半阙折子戏
    2020-11-27 11:10

    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 update
    sudo 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 update
    composer require cviebrock/eloquent-sluggable
    

提交回复
热议问题