当前位置: 首页>>技术教程>>正文


Lampp php配置

, , ,

问题描述

操作系统:Ubuntu 17.10我安装了LAMPP和Laravel。当我尝试composer install时出现以下错误

  - Installation request for phar-io/manifest 1.0.1 -> satisfiable by phar-io/manifest[1.0.1].
    - phar-io/manifest 1.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 2
    - Installation request for phpunit/php-code-coverage 5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
    - phpunit/php-code-coverage 5.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 3
    - Installation request for phpunit/phpunit 6.4.3 -> satisfiable by phpunit/phpunit[6.4.3].
    - phpunit/phpunit 6.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 4
    - Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
    - theseer/tokenizer 1.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/20-calendar.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-exif.ini
    - /etc/php/7.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.1/cli/conf.d/20-ftp.ini
    - /etc/php/7.1/cli/conf.d/20-gettext.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-mbstring.ini
    - /etc/php/7.1/cli/conf.d/20-pdo.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-readline.ini
    - /etc/php/7.1/cli/conf.d/20-shmop.ini
    - /etc/php/7.1/cli/conf.d/20-sockets.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

我重新检查文件所有扩展都已启用,扩展名在/usr/lib/php/20160303文件夹中。

最佳解决方案

有时问题是php-xml扩展。

尝试:

sudo apt-get install php-xml

次佳解决方案

如果仍然面临问题,那么试试吧

sudo apt-get install -y php7.1 php7.1-xml php7.1-mysql php7.1-curl php7.1-mbstring

第三种解决方案

尝试以下命令:

sudo apt-get install php-mbstring
sudo apt-get install php-xml

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/6437.html,未经允许,请勿转载。