php - ubuntu 16.04 中 laravel 安装错误

标签 php laravel ubuntu installation ubuntu-16.04

我在 laravel 中安装错误时遇到了麻烦。 首先在ubuntu 16.04中安装xampp。 之后

cd /opt/lampp/htdocs/
composer create-project --prefer-dist laravel/laravel blog

安装 Laravel 和 Composer 时出现错误

E: Package 'php5-mcrypt' has no installation candidate
shwekayin@shwekayin-VirtualBox:/opt/lampp/htdocs$ composer create-project --prefer-dist laravel/laravel blog1
Installing laravel/laravel (v5.3.0)
  - Installing laravel/laravel (v5.3.0)
    Loading from cache

Created project in blog1
> php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.3.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.3.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.3.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.3.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.3.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.3.* -> satisfiable by laravel/framework[v5.3.0, v5.3.1, v5.3.2, v5.3.3, v5.3.4].

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

如何修复此错误。我的xampp php版本是7.0.10

最佳答案

错误消息详细说明了错误所在:

laravel/framework v5.3.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.

运行sudo apt install php-mbstring来安装它。

关于php - ubuntu 16.04 中 laravel 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39200967/

相关文章:

ubuntu - vagrant destroy 后保留 vagrant 数据库数据

PHP:索引数组中索引的真正含义是什么?

php - 更改我的 .htaccess 文件后,我的 php 上的 POST 方法不再起作用

javascript - 使用 jquery 自定义喜欢计数器

python - 在 Ubuntu Server 16.04LTS 上将 JSON 写入文件导致 Unicode 错误

node.js - 使用 npm 安装 Ganache 后权限被拒绝

php从数组集中删除父级数组并合并节点

php - 根据旧记录的值从查询中获取新记录

php - Eloquent ORM查询数据库时数组索引的问题

php - Laravel 中发生注销事件时发布时间戳数据