gpt4 book ai didi

linux - 如何在 ubuntu 16.04 中安装 laravel 5.6?

转载 作者:IT王子 更新时间:2023-10-29 00:31:32 28 4
gpt4 key购买 nike

我使用以下命令将 PHP 7.0 升级到 7.1:

1. sudo add-apt-repository ppa:ondrej/php
2. sudo apt-get update
3. sudo apt-get install php7.1

并从 laravel.com 运行这个命令:

composer create-project --prefer-dist laravel/laravel blog

运行此代码后,出现以下错误:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- laravel/framework v5.6.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework 5.6.x-dev requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for laravel/framework 5.6.* -> satisfiable by laravel/framework[5.6.x-dev, v5.6.0].

To enable extensions, verify that they are enabled in those .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-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.

更新 1:

我运行这个命令: sudo apt-get install php7.1-mbstring sudo apt-get install libapache2-mod-php7.1

afetr 运行 composer create-project --prefer-dist laravel/laravel blog 命令,显示错误:

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info


[Composer\Downloader\TransportException]
Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details.

如何解决这个错误?

最佳答案

你需要,

安装mbstring:

sudo apt-get install php7.1-mbstring
sudo apt-get install libapache2-mod-php7.1

然后,

重启你的服务器:

sudo service apache2 restart
or
sudo service nginx restart

要解决 Composer 的错误,请运行:

sudo composer self-update

sudo composer clear-cache

sudo composer config -g secure-http false

关于linux - 如何在 ubuntu 16.04 中安装 laravel 5.6?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48683431/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com