Alguém instalou o laravel 5 no Ubuntu 16.04? Acabei de mudar para o Ubuntu 16.04 e estou tentando instalar o laravel 5 framework usando o composer. Mas toda vez que tento criar um projeto, isso me dá esses erros
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/laravel v5.2.0 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.15 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.23 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.24 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.27 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.29 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/laravel v5.2.31 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[v5.2.0, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9].
- laravel/framework v5.2.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.31 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.30 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- laravel/framework v5.2.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for laravel/laravel ^5.2 -> satisfiable by laravel/laravel[v5.2.0, v5.2.15, v5.2.23, v5.2.24, v5.2.27, v5.2.29, v5.2.31].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/5.6/cli/php.ini
- /etc/php/5.6/cli/conf.d/10-opcache.ini
- /etc/php/5.6/cli/conf.d/10-pdo.ini
- /etc/php/5.6/cli/conf.d/20-calendar.ini
- /etc/php/5.6/cli/conf.d/20-ctype.ini
- /etc/php/5.6/cli/conf.d/20-exif.ini
- /etc/php/5.6/cli/conf.d/20-fileinfo.ini
- /etc/php/5.6/cli/conf.d/20-ftp.ini
- /etc/php/5.6/cli/conf.d/20-gettext.ini
- /etc/php/5.6/cli/conf.d/20-iconv.ini
- /etc/php/5.6/cli/conf.d/20-json.ini
- /etc/php/5.6/cli/conf.d/20-phar.ini
- /etc/php/5.6/cli/conf.d/20-posix.ini
- /etc/php/5.6/cli/conf.d/20-readline.ini
- /etc/php/5.6/cli/conf.d/20-shmop.ini
- /etc/php/5.6/cli/conf.d/20-sockets.ini
- /etc/php/5.6/cli/conf.d/20-sysvmsg.ini
- /etc/php/5.6/cli/conf.d/20-sysvsem.ini
- /etc/php/5.6/cli/conf.d/20-sysvshm.ini
- /etc/php/5.6/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.
Installation failed, deleting ./composer.json.
Eu li artigos Aqui, um deles diz que o Ubuntu 16.04 vem com o PHP7 como padrão, mas ainda podemos usar o PHP5. No entanto, tentei o PHP7 e o PHP5 e ainda recebo os mesmos erros! Alguma ideia? obrigado
Eu havia atualizado o php 5.6.11 para 5.6.21.
Então, no meu caso, eu tive que executar:
PS: Como atualizei de 5.6.11 para 5.6.21 a seguir:
Motivo da atualização: zend_mm_heap corrompido durante a atualização do compositor.
fonte
Estas são as etapas que eu tive que executar para instalar o Laravel 5 no Ubuntu Server 16.04 após uma nova atualização
Primeiro, tive que remover completamente todo o PHP, assim como Mohammad Barhoush afirmou:
sudo apt-get -y purge php.*
Então eu reinstalei o PHP com:
sudo apt install php libapache2-mod-php
sudo apt install php-cli
sudo apt install php-mysql
Depois de reinstalar o PHP ver.7.0, instalei os pacotes relacionados adicionais que Mohhammad recomendou:
sudo apt-get install curl php-curl php-mcrypt php-mbstring php-gettext php-gd
E habilitou os mods
sudo phpenmod mcrypt
sudo phpenmod mbstring
E finalmente, depois que todo esse compositor ainda estava sofrendo, ele não tinha a extensão zip para
composer update
instalar, então eu instalei o seguinte:sudo apt-get install php7.0-zip
Depois disso, correu muito bem, sem erros!
Estas foram as etapas necessárias para que o laravel 5 funcione da versão LTS anterior do Ubuntu Server. Espero que isso tenha ajudado! Cumprimentos :)
-Derick
fonte
A extensão mbstring do PHP agora reside em um pacote separado, então você precisa:
fonte
A solução do oerdnj funciona, após a instalação,
mbstring
você deve habilitá-laphp.ini
antes da execuçãocomposer install
. No meu caso, o laravel requer ext-mbstring e ext-dom:apt-get install php-dom
fonte
Obrigado a todos por suas respostas. Finalmente, sou capaz de resolver esse problema:
Remova completamente o php primeiro:
sudo apt-get -y purge php.*
Reinstale o php e estes importantes pacotes relacionados:
sudo apt-get install curl php-curl php-mcrypt php-mbstring php-gettext
Ativar mods (Graças ao vídeo lewis4u):
sudo phpenmod mcrypt
sudo phpenmod mbstring
fonte
Lá você precisa fazer algo manualmente no arquivo de configuração. Descobri que este artigo foi realmente útil. Primeiro, verifique se a biblioteca mbstring.dll do tempo já está instalada no sistema usando a função 'phpinfo ()'. Se estiver ativado, em vez de descomentar 'extension = php_mbstring.dll', mantenha-o comentado no arquivo de configuração php.ini ou, se não estiver instalado, instale-o
sudo apt-get install php-mbstring php7.0-mbstring
Em seguida, basta configurar o seguinte.
É isso aí .. Acho que você sabe o resto das coisas, como instalar o laravel e tudo mais ..
fonte
Então, eu tive o mesmo problema que o cara acima, onde eu precisava instalar o php-dom, então tentei rodar,
apt-get install php-dom
mas ele apareceu com a mensagemComo sou um pouco novo no terminal, achei isso um pouco confuso, mas como o Ubuntu 16.04 estava rodando o php7, executei:
apt-get install php7.0-xml
e funcionou para mim ... espero que ajude alguém!fonte
Para instalar
Laravel 5.4
emUbuntu 16.04
como na documentação Laravel com cheque:php -v
:, sua versão do php deve serPHP >= 5.6.4
php -m
forOpenSSL PHP Extension
ePDO PHP Extension
.Terminal:
sudo apt install php-mbstring
e verifique novamente porphp -m
deMbstring PHP Extension
eTokenizer PHP Extension
.Terminal:
sudo apt install php-xml
e verifique novamente porphp -m
paraXML PHP Extension
Faça o download do Composer seguindo estas 4 etapas no terminal:
php -r "copy (' https://getcomposer.org/installer ', 'compositer-setup.php');"
php -r "if (hash_file ('SHA384', 'compositer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa035560' '' install '' php ');} echo PHP_EOL; "
php composer-setup.php
php -r "desvincular ('composer-setup.php');"
Verifique o compositor no terminal:
php composer.phar
Instale o Laravel no terminal:
php composer.phar global require "laravel/installer"
A saída no terminal mostrará seu diretório atual
/home/yourname/.config/composer
, vá para o diretório atual e pressionectrl+h
para mostrar o arquivo oculto.Vá para a
.config
pasta ecomposer
pasta com o seguinte conteúdo: conteúdo da pasta compositorCriar
Laravel project
em/var/www/html
no terminal:php composer.phar create-project --prefer-dist laravel/laravel /var/www/html/myLaravel
Abra o myLaravel no terminal, cole:
php artisan serve
e copiehttp://127.0.0.1:8000
no seu navegadorfonte