加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-14 00:58:59 所属栏目:Linux 来源:网络整理
导读:我用这个命令将 PHP 7.0升级到7.1: 1. sudo add-apt-repository ppa:ondrej/php2. sudo apt-get update3. sudo apt-get install php7.1 并从laravel.com运行此命令: 作曲家创作项目–prefer-dist laravel / laravel博客 运行此代码后,出现以下错误: Your
我用这个命令将 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运行此命令:

作曲家创作项目–prefer-dist laravel / laravel博客

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

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 run 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


[ComposerDownloaderTransportException]                                                                                                     
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读