laravel LAMP PHP 配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47493587/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
LAMP PHP Configuration
提问by Arafath
OS : Ubuntu 17.10
I have installed LAMP stack and Laravel, and when I tried composer installin my Laravel app, I got the following errors.
操作系统:Ubuntu 17.10
我已经安装了 LAMP 堆栈和 Laravel,当我composer install在我的 Laravel 应用程序中尝试时,出现以下错误。
- 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.
I have rechecked the files, all extensions are enabled and they are located in
/usr/lib/php/20160303folder.
我重新检查了文件,启用了所有扩展名,并且它们位于
/usr/lib/php/20160303文件夹中。
回答by Eduardo Pacios
Sometimes the problem is the php-xml extension.
有时问题出在 php-xml 扩展名上。
Try:
尝试:
sudo apt-get install php-xml
回答by saif
If still facing the issue then try
如果仍然面临问题,请尝试
sudo apt-get install -y php7.1 php7.1-xml php7.1-mysql php7.1-curl php7.1-mbstring
sudo apt-get install -y php7.1 php7.1-xml php7.1-mysql php7.1-curl php7.1-mbstring
回答by Bijaya Kumar Oli
Try following command :
尝试以下命令:
sudo apt-get install php-mbstring
sudo apt-get install php-xml
回答by Syed Shibli
As the log speaks we need to install the extension dom. This is how we do it:
正如日志所说,我们需要安装扩展 dom。这是我们的做法:
sudo apt install php7.1-dom
If the log shows only one extension missing, than above command works. If there are other extension missing, you can add those extension in the same line like shown below:
如果日志仅显示缺少一个扩展名,则上述命令有效。如果缺少其他扩展名,您可以在同一行中添加这些扩展名,如下所示:
sudo apt install php7.1-dom php7.1-ext-mbstring
That's it. Now you won't have any issues in installing composer. Enter composer install
就是这样。现在您在安装 composer 时不会有任何问题。输入作曲家安装

