Solucionado (ver solução)
Solucionado
(ver solução)
14
respostas

Não estou conseguindo installar o PHP 5 no Ubuntu 16.04

Não estou conseguindo instalar o php 5, php5-mcrypt, php5-json entre outros no Ubuntu 16.04 poderiam me ajudar por favor, poderiam fazer um passo a passo como instalar o PHP até o Laravel,quero muito estudar laravel. :)

14 respostas

Oi Mateus,

você tentou rodar os apt-gets que estão no link de instalação do exercício?

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5-json
sudo apt-get install openssl
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt

aqui o passo a passo do Ubuntu: https://gist.github.com/Turini/843fa49af3ada5599c69

Se não funcionar, nos mande o erro que aparece pra você.

solução!

Olá, Mateus, tudo bem?

Na verdade, nesse curso a versão mínima para o php tem que ser a 5.4, porém também é possível rodar nas versões mais atualizadas do php. No caso do Ubuntu 16.04, se você rodar o comando:

sudo apt-get install php

será instalado o php 7 e tudo o mais necessário, que também pode ser usado neste curso com o Laravel. E para instalar o Laravel, é só seguir as instruções deste link https://gist.github.com/Turini/843fa49af3ada5599c69

Qualquer dúvida, é só falar!

Vitor

Fica viável eu utilizar o PHP 7 para fazer o curso de Laravel?

Sim!

Vitor

Você poderia me enviar os comandos necessário para fazer toda a instalação do laravel com php 7, porque eu instalei tudo legal mais não funcionou o laravel new estoque, e deu erro ao tentar utilizar o comando php artisan serve.

Matheus

consegue nos mandar o erro que acontece? assim podemos te ajudar investigar e corrigir

Eu fiz os seguintes comandos para installar o PHP7 e o Laravel:

$ sudo apt-get install php
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ composer global require "laravel/installer=~1.1"
$ export PATH="~/.composer/vendor/bin:$PATH"
$ sudo apt-get update
$ sudo apt-get install php-json
$ sudo apt-get install openssl
$ sudo apt-get install php-mcrypt
$ sudo php5enmod mcrypt

Mas ao executar o comando laravel new estoque, o terminal informar que o comando laravel não foi encontrado .

E ao executar o comando php artisan serve ele informa o seguinte erro :

PHP Warning:  require(/home/mateus/estoque/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/mateus/estoque/bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/home/mateus/estoque/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/mateus/estoque/bootstrap/autoload.php on line 17

experimenta abrir a pasta do seu projeto e rodar "composer install" nela?

sobre o comando laravel não ser encontrado, você precisa adicionar no PATH o caminho de instalação dele. Se você está usando composer, no windows, deve ser algo como "C:\ProgramData\ComposerSetup\bin"

Rodrigo, já consegui ajeitar a minha variável de ambiente PATH agora o comando laravel new estoque funcionou normalmente.

Estou apenas com o erro ao utilizar o comando php artisan serve ele informa o seguinte erro:

Warning:  require(/home/mateus/estoque/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/mateus/estoque/bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/home/mateus/estoque/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/mateus/estoque/bootstrap/autoload.php on line 17

você tentou rodar o composer install no projeto? vale tentar também um composer update.

Ao executar o comando composer install aparece o seguinte erro:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.0.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.35 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.34 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.33 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.32 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework v5.0.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - laravel/framework 5.0.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22, v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31, v5.0.32, v5.0.33, v5.0.34, v5.0.35, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].

  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-mysqlnd.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-mcrypt.ini
    - /etc/php/7.0/cli/conf.d/20-mysqli.ini
    - /etc/php/7.0/cli/conf.d/20-pdo_mysql.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
    - /etc/php/7.0/cli/conf.d/20-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Oi Matheus

Essa é a parte importante do output:

the requested PHP extension mbstring is missing from your system

Ele está dizendo que precisa da extensão mbstring, e que você não tem instalado.

Veja se ela existe no seu PHP? Você pode fazer isso rodando php -m.

Se não tiver, aqui tem instruções de instalação de extensões do PHP no windows:

http://php.net/manual/it/install.windows.extensions.php

Olá Rodrigo, muito obrigado mesmo, estou me sentido super lisonjeado e muito feliz com a agilidade dos instrutores ao me dá uma resposta.