简体   繁体   English

ubuntu 16.04中的laravel安装错误

[英]laravel installation error in ubuntu 16.04

I am having trouble while installation error in laravel. 我在laravel中安装错误时遇到麻烦。 First install xampp in ubuntu 16.04. 首先在Ubuntu 16.04中安装xampp。 After that 之后

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

installation laravel with composer some error occurs 与作曲家安装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.

How can I fix this error. 如何解决此错误。 My xampp php version is 7.0.10 我的xampp php版本是7.0.10

The error message details what is wrong: 该错误消息详细说明了问题所在:

laravel/framework v5.3.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. laravel / framework v5.3.4需要ext-mbstring *->系统中缺少所请求的PHP扩展名mbstring。

Run sudo apt install php-mbstring to install it. 运行sudo apt install php-mbstring进行安装。

Run this 运行这个

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

if you no need to update php 7 again, Just run this 如果您不需要再次更新php 7,只需运行

sudo apt-get install php-mcrypt 

Install optional components these as well 同时安装这些可选组件

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

Best ever tutorial How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04 -used and works for me 有史以来最好的教程- 如何在Ubuntu 16.04上安装Linux,Apache,MySQL,PHP(LAMP)堆栈 -已使用并为我工作

By default Ubuntu 16.04 has php7.0 installed. 默认情况下,Ubuntu 16.04已安装php7.0。 You need to install first php5 (in your case here). 您需要先安装php5(以您的情况为例)。 And then switch to php5 before reinstalling laravel. 然后在重新安装laravel之前切换到php5。

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

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

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