Ошибка установки laravel в ubuntu 16.04

У меня проблема при установке в laravel. Сначала установите xampp в ubuntu 16.04. После этого

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

установка laravel с композитором возникает ошибка

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


person Saw Theodore    schedule 29.08.2016    source источник


Ответы (3)


В сообщении об ошибке указывается, что не так:

laravel / framework v5.3.4 требует ext-mbstring * -> запрошенное расширение PHP mbstring отсутствует в вашей системе.

Запустите sudo apt install php-mbstring, чтобы установить его.

person Chris White    schedule 29.08.2016

Запустите это

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

если вам не нужно снова обновлять php 7, просто запустите это

sudo apt-get install php-mcrypt 

Также установите дополнительные компоненты

libnet-libidn-perl - Perl bindings for GNU Libidn
php-all-dev - package depending on all supported PHP development packages
php-cgi - server-side, HTML-embedded scripting language (CGI binary) (default)
php-cli - command-line interpreter for the PHP scripting language (default)
php-common - Common files for PHP packages
php-curl - CURL module for PHP [default]
php-dev - Files for PHP module development (default)
php-gd - GD module for PHP [default]
php-gmp - GMP module for PHP [default]

sudo apt-get install package_name

Лучшее руководство Как установить стек Linux, Apache, MySQL, PHP (LAMP) на Ubuntu 16.04 - используется и работает у меня

person Abdulla Nilam    schedule 29.08.2016
comment
Проблема 1 - phpunit / phpunit 5.5.4 требует ext-dom * - ›запрошенное расширение PHP dom отсутствует в вашей системе. - phpunit / phpunit 5.5.3 требует ext-dom * - ›запрошенное расширение PHP dom отсутствует в вашей системе. - person Saw Theodore; 30.08.2016

По умолчанию в Ubuntu 16.04 установлен php7.0. Вам необходимо установить сначала php5 (в вашем случае здесь). А затем переключитесь на php5 перед переустановкой laravel.

https://askubuntu.com/questions/756879/cant-install-php5-on-ubuntu-16-04

person Confused    schedule 15.09.2016