简体   繁体   English

无法在Ubuntu 18.10 LEMP堆栈上安装Laravel?

[英]Unable to install Laravel on Ubuntu 18.10 LEMP stack?

When running laravel new I receive all these errors. 运行laravel new我收到所有这些错误。 I understand what they mean, but I'm curious to why this happenes, on windows it all went through fine. 我理解他们的意思,但我很好奇为什么会发生这种情况,在Windows上这一切都很顺利。

I installed php, how come Ubuntu throws errors? 我安装了php,为什么Ubuntu会抛出错误? Does it exclude a lot of things from the php installation? 它是否从php安装中排除了很多东西? I'm not really sure why its causing so much drama, this is the 10th set of errors I've gone through today and I'm worried I've done something majorly wrong. 我不确定为什么它会引起如此多的戏剧性,这是我今天经历的第10组错误,我担心我做了一些重大错误。

I followed this for my LEMP stack: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04 我按照这个为我的LEMP堆栈: https//www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04

Also, before I can even use the laravel command, I have to run export PATH="~/.composer/vendor/bin:$PATH" every time I open a terminal. 另外,在我甚至可以使用laravel命令之前,每次打开终端时都必须运行export PATH="~/.composer/vendor/bin:$PATH" Is there a way to fix this? 有没有办法解决这个问题?

  Problem 1
    - Installation request for erusev/parsedown v1.7.2 -> satisfiable by erusev/parsedown[v1.7.2].
    - erusev/parsedown v1.7.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for laravel/framework v5.8.7 -> satisfiable by laravel/framework[v5.8.7].
    - laravel/framework v5.8.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - Installation request for phar-io/manifest 1.0.3 -> satisfiable by phar-io/manifest[1.0.3].
    - phar-io/manifest 1.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 4
    - Installation request for phpunit/php-code-coverage 6.1.4 -> satisfiable by phpunit/php-code-coverage[6.1.4].
    - phpunit/php-code-coverage 6.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 5
    - Installation request for phpunit/phpunit 7.5.7 -> satisfiable by phpunit/phpunit[7.5.7].
    - phpunit/phpunit 7.5.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 6
    - 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.
  Problem 7
    - laravel/framework v5.8.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - beyondcode/laravel-dump-server 1.2.2 requires illuminate/console 5.6.*|5.7.*|5.8.* -> satisfiable by laravel/framework[v5.8.7].
    - Installation request for beyondcode/laravel-dump-server 1.2.2 -> satisfiable by beyondcode/laravel-dump-server[1.2.2].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.2/cli/php.ini
    - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.2/cli/conf.d/10-opcache.ini
    - /etc/php/7.2/cli/conf.d/10-pdo.ini
    - /etc/php/7.2/cli/conf.d/20-calendar.ini
    - /etc/php/7.2/cli/conf.d/20-ctype.ini
    - /etc/php/7.2/cli/conf.d/20-exif.ini
    - /etc/php/7.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.2/cli/conf.d/20-ftp.ini
    - /etc/php/7.2/cli/conf.d/20-gettext.ini
    - /etc/php/7.2/cli/conf.d/20-iconv.ini
    - /etc/php/7.2/cli/conf.d/20-json.ini
    - /etc/php/7.2/cli/conf.d/20-mbstring.ini
    - /etc/php/7.2/cli/conf.d/20-mysqli.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.2/cli/conf.d/20-phar.ini
    - /etc/php/7.2/cli/conf.d/20-posix.ini
    - /etc/php/7.2/cli/conf.d/20-readline.ini
    - /etc/php/7.2/cli/conf.d/20-shmop.ini
    - /etc/php/7.2/cli/conf.d/20-sockets.ini
    - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.2/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.2/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.

Which PHP version are you using? 您使用的是哪个PHP版本?

You need mbstring extension installed. 您需要安装mbstring扩展。

Assuming it's PHP7.2, you can install the dependencies required for Laravel like: 假设它是PHP7.2,您可以安装Laravel所需的依赖项,如:

sudo apt install php7.2-mbstring php7.2-dom php7.2-pdo php7.2-xml php7.2-common php7.2-bcmath php7.2-json php7.2-cli php7.2-fpm php7.2-mysql

Edit : That LEMP guide doesn't cover php extensions' installation. 编辑 :LEMP指南不包括php扩展的安装。

Assuimg it's Laravel 5.8, according to the docs , you need some extensions installed, too. 根据文档 ,确定它是Laravel 5.8,你也需要安装一些扩展。 Updating my answer accordingly 相应地更新我的答案

Note: If you need MySQL etc (because you mentioned LEMP) I've also added php7.2-mysql. 注意:如果你需要MySQL等(因为你提到了LEMP)我还添加了php7.2-mysql。

Although, like I mentioned in my comments, I'd prefer Ondrej Sury's PPA and install PHP7.3 and its extensions instead. 虽然,就像我在评论中提到的那样,我更喜欢Ondrej Sury的PPA并安装PHP7.3及其扩展。

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

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