简体   繁体   English

无法通过Composer安装Laravel

[英]Can't install Laravel via Composer

I have a problem Composer and Laravel. 我在作曲家和Laravel时遇到问题。 I found a lot of similar topic but it doesn't work. 我发现了很多类似的话题,但是没有用。 So when I try install Laravel it will show me: Installing laravel/laravel (v5.5.22) 因此,当我尝试安装Laravel时,它将向我显示:安装laravel / laravel(v5.5.22)

  • Installing laravel/laravel (v5.5.22): Loading from cache Created project in sadsa 安装laravel / laravel(v5.5.22):从缓存加载在sadsa中创建的项目

    @php -r "file_exists('.env') || copy('.env.example', '.env');" @php -r“ file_exists('。env')||复制('.env.example','.env');” Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. 使用软件包信息加载composer存储库更新依赖关系(包括require-dev)您的需求无法解决为一组可安装的软件包。

    Problem 1 问题1

    • phpunit/phpunit 6.5.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.5需要ext-dom *->您的系统缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.5.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.4需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.5.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.3要求ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.2需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.1需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.5.0要求ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.4.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.4.4需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.4.3需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.4.2需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.4.1需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.4.0需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.3.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.3.1需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.3.0需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.2.4需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.2.3需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.2.2需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.2.1需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.2.0需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.1.4需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.1.3需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.1.2需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.1.1需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.1.0需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.9 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.9需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.8 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.8需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.7需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.6 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.6需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.5 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.5需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.4需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.3需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.2需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.13 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.13需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.12 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.12需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.11 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.11需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.10 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.10需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.1需要ext-dom *->系统中缺少所请求的PHP扩展dom。
    • phpunit/phpunit 6.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system. phpunit / phpunit 6.0.0需要ext-dom *->您的系统中缺少所请求的PHP扩展dom。
    • Installation request for phpunit/phpunit ~6.0 -> satisfiable by phpunit/phpunit[6.0.0, 6.0.1, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.3.0, 6.3.1, 6.4.0, 6.4.1, 6.4.2, 6.4.3, 6.4.4, 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.5.4, 6.5.5]. phpunit / phpunit〜6.0的安装请求-> phpunit / phpunit可满足[6.0.0、6.0.1、6.0.10、6.0.11、6.0.12、6.0.13、6.0.2、6.0.3、6.0。 4,6.0.5,6.0.6,6.0.7,6.0.8,6.0.9,6.1.0,6.1.1,6.1.2,6.1.3,6.1.4,6.2.0,6.2.1, 6.2.2、6.2.3、6.2.4、6.3.0、6.3.1、6.4.0、6.4.1、6.4.2、6.4.3、6.4.4、6.5.0、6.5.1、6.5。 2,6.5.3,6.5.4,6.5.5]。

    To enable extensions, verify that they are enabled in your .ini files: 要启用扩展,请确认您的.ini文件中已启用扩展:

    • /etc/php/7.0/cli/php.ini /etc/php/7.0/cli/php.ini
    • /etc/php/7.0/cli/conf.d/10-opcache.ini /etc/php/7.0/cli/conf.d/10-opcache.ini
    • /etc/php/7.0/cli/conf.d/10-pdo.ini /etc/php/7.0/cli/conf.d/10-pdo.ini
    • /etc/php/7.0/cli/conf.d/20-calendar.ini /etc/php/7.0/cli/conf.d/20-calendar.ini
    • /etc/php/7.0/cli/conf.d/20-ctype.ini /etc/php/7.0/cli/conf.d/20-ctype.ini
    • /etc/php/7.0/cli/conf.d/20-exif.ini /etc/php/7.0/cli/conf.d/20-exif.ini
    • /etc/php/7.0/cli/conf.d/20-fileinfo.ini /etc/php/7.0/cli/conf.d/20-fileinfo.ini
    • /etc/php/7.0/cli/conf.d/20-ftp.ini /etc/php/7.0/cli/conf.d/20-ftp.ini
    • /etc/php/7.0/cli/conf.d/20-gettext.ini /etc/php/7.0/cli/conf.d/20-gettext.ini
    • /etc/php/7.0/cli/conf.d/20-iconv.ini /etc/php/7.0/cli/conf.d/20-iconv.ini
    • /etc/php/7.0/cli/conf.d/20-json.ini /etc/php/7.0/cli/conf.d/20-json.ini
    • /etc/php/7.0/cli/conf.d/20-mbstring.ini /etc/php/7.0/cli/conf.d/20-mbstring.ini
    • /etc/php/7.0/cli/conf.d/20-mcrypt.ini /etc/php/7.0/cli/conf.d/20-mcrypt.ini
    • /etc/php/7.0/cli/conf.d/20-phar.ini /etc/php/7.0/cli/conf.d/20-phar.ini
    • /etc/php/7.0/cli/conf.d/20-posix.ini /etc/php/7.0/cli/conf.d/20-posix.ini
    • /etc/php/7.0/cli/conf.d/20-readline.ini /etc/php/7.0/cli/conf.d/20-readline.ini
    • /etc/php/7.0/cli/conf.d/20-shmop.ini /etc/php/7.0/cli/conf.d/20-shmop.ini
    • /etc/php/7.0/cli/conf.d/20-sockets.ini /etc/php/7.0/cli/conf.d/20-sockets.ini
    • /etc/php/7.0/cli/conf.d/20-sysvmsg.ini /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
    • /etc/php/7.0/cli/conf.d/20-sysvsem.ini /etc/php/7.0/cli/conf.d/20-sysvsem.ini
    • /etc/php/7.0/cli/conf.d/20-sysvshm.ini /etc/php/7.0/cli/conf.d/20-sysvshm.ini
    • /etc/php/7.0/cli/conf.d/20-tokenizer.ini /etc/php/7.0/cli/conf.d/20-tokenizer.ini
    • /etc/php/7.0/cli/conf.d/20-xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini
    • /etc/php/7.0/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. /etc/php/7.0/cli/conf.d/20-zip.ini您还可以在终端内运行php --ini ,以查看CLI模式下PHP使用了哪些文件。

When I try install it globally, I have this but I can't use Laravel new something command: 当我尝试在全局安装它时,我已经有了这个,但是我不能使用Laravel new something命令:

Changed current directory to /home/michal/.composer Using version ^1.5 for laravel/installer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files How I said I found a lot of topic but nothing works like install mbstring and so on. 已将当前目录更改为/home/michal/.composer使用laravel / installer的^ 1.5版。/composer.json已更新加载包含程序包信息的composer存储库更新依赖项(包括require-dev)无需安装或更新任何内容生成自动加载文件的方式我说我发现了很多主题,但是没有什么可以像安装mbstring这样工作。

Looks to me it is mainly focus at message requires ext-dom . 在我看来,它主要集中在requires ext-dom消息上。 Possible work around i can suggest is to install following packages: 我可以建议的可能的解决方法是安装以下软件包:

  • php-xml PHP的XML

  • php-common PHP常见

Or you can try with specific php version as follow: 或者您可以尝试使用特定的php版本,如下所示:

  • php7.0-xml php7.0的XML

  • php7.0-common php7.0常见

for php 7.0 对于php 7.0

 sudo apt-get install php7.0-xml

I am using Ubuntu 17.10 and PHP 7.1 is running well using 我正在使用Ubuntu 17.10,并且使用PHP 7.1运行良好

sudo apt-get install php7.1-xml

If you are using another version of PHP, for example: 7.0 can change it to 例如,如果您使用的是其他版本的PHP,则7.0可以将其更改为

sudo apt-get install php7.0-xml

Don't forget to alwasy restart web server, for example in Ubuntu you can type in terminal: 不要忘了重启网络服务器,例如在Ubuntu中,您可以输入终端:

sudo service apache2 reload

After that you can try run composer again. 之后,您可以尝试再次运行composer。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM