Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install laravel 5.6 in ubuntu 16.04?

Tags:

I upgraded PHP 7.0 to 7.1 with this command:

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

and ran this command from laravel.com:

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

After ran this code, got following error:

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.

UPDATE 1:

I run this command: 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 command, show error:

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. 

How to solve this error ?

like image 809
mySun Avatar asked Feb 08 '18 10:02

mySun


1 Answers

You need to,

Install mbstring:

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

and then,

Restart your server:

sudo service apache2 restart
or
sudo service nginx restart

To solve the error with composer, run:

sudo composer self-update

sudo composer clear-cache

sudo composer config -g secure-http false
like image 185
Sapnesh Naik Avatar answered Oct 02 '22 23:10

Sapnesh Naik