laravel installation error in ubuntu 16.04 - php

I am having trouble while installation error in laravel.
First install xampp in ubuntu 16.04.
After that
cd /opt/lampp/htdocs/
composer create-project --prefer-dist laravel/laravel blog
installation laravel with composer some error occurs
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

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.
Run sudo apt install php-mbstring to install it.

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
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

By default Ubuntu 16.04 has php7.0 installed. You need to install first php5 (in your case here). And then switch to php5 before reinstalling laravel.
https://askubuntu.com/questions/756879/cant-install-php5-on-ubuntu-16-04

Related

Composer install Laravel: Your requirements could not be resolved to an installable set of packages

I'm trying to install Laravel using composer for the first time.
Following the documentation on https://laravel.com/docs/5.1, I tried doing it with the command sudo composer global require "laravel/installer".
The output I got is pasted below:
Changed current directory to /home/israel/.composer
Using version ^2.0 for laravel/installer
./composer.json has been created
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/installer v2.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v2.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^2.0 -> satisfiable by laravel/installer[v2.0.0, v2.0.1].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/15-xml.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-curl.ini
- /etc/php/7.2/cli/conf.d/20-dom.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-mbstring.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-simplexml.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
- /etc/php/7.2/cli/conf.d/20-wddx.ini
- /etc/php/7.2/cli/conf.d/20-xmlreader.ini
- /etc/php/7.2/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.2/cli/conf.d/20-xsl.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.
Does this mean PHP isn't installed?
Just run sudo apt-get install php7.2-zip && sudo apt-get install php-zip. After which you would run the command (sudo composer global require "laravel/installer") again.
It should work just fine.
It actually did. :)
If you try
sudo apt-get install php7.2-zip
and you run into the error:
sudo: apt-get: command not found
Then, try it with homebrew instead:
brew install php
This worked for me. Hopefully it saves someone a few minutes of extra head scratching :) Happy coding!
Have a look at the Laravel requirements:
PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
Do you meet them? Your Error message states, that your environment does not meet the PHP version and extensions, so you have to install them first.
Once you have installed the correct PHP version and the corresponding extensions, composer will be able to install laravel as desired.
Hope this helps! :)

LAMP PHP configuration

OS: Ubuntu 17.10 (Artful Aardvark)
I have installed the LAMP stack and Laravel, and when I tried composer install in my Laravel application, I got the following errors.
- Installation request for phar-io/manifest 1.0.1 -> satisfiable by phar-io/manifest[1.0.1].
- phar-io/manifest 1.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
- Installation request for phpunit/php-code-coverage 5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
- phpunit/php-code-coverage 5.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 3
- Installation request for phpunit/phpunit 6.4.3 -> satisfiable by phpunit/phpunit[6.4.3].
- phpunit/phpunit 6.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 4
- Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
- theseer/tokenizer 1.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
To enable extensions, verify that they are enabled in your .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-mbstring.ini
- /etc/php/7.1/cli/conf.d/20-pdo.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.
I have rechecked the files, all extensions are enabled and they are located in the
/usr/lib/php/20160303 folder.
Sometimes the problem is the php-xml extension.
Try:
sudo apt-get install php-xml
If still facing the issue then try
sudo apt-get install -y php7.1 php7.1-xml php7.1-mysql php7.1-curl php7.1-mbstring
Try following command:
sudo apt-get install php-mbstring
sudo apt-get install php-xml
As the log speaks we need to install the extension "dom". This is how we do it:
sudo apt install php7.1-dom
If the log shows only one extension missing, then the above command works. If there are other extensions missing, you can add those extensions in the same line like shown below:
sudo apt install php7.1-dom php7.1-ext-mbstring
That’s it. Now you won’t have any issues in installing PHP Composer. Enter composer install.

installing CakePhp: "Your requirements could not be resolved to an installable set of packages" error

I'm trying to install cakephp using composer with this tutorial but after I run the command:
sudo composer create-project --prefer-dist cakephp/app my_app_name
I get the error:
Problem 1
- cakephp/cakephp-codesniffer 3.0.0 requires squizlabs/php_codesniffer ^3.0.0 -> satisfiable by squizlabs/php_codesniffer[3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1].
- cakephp/cakephp-codesniffer 3.0.1 requires squizlabs/php_codesniffer ^3.0.0 -> satisfiable by squizlabs/php_codesniffer[3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1].
- squizlabs/php_codesniffer 3.1.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- squizlabs/php_codesniffer 3.1.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- squizlabs/php_codesniffer 3.0.2 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- squizlabs/php_codesniffer 3.0.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- squizlabs/php_codesniffer 3.0.0 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
- Installation request for cakephp/cakephp-codesniffer ^3.0 -> satisfiable by cakephp/cakephp-codesniffer[3.0.0, 3.0.1].
To enable extensions, verify that they are enabled in your .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-curl.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-intl.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.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.
I installed codeSniffer using both curl and composer. still I can't get rid of the error. any ideas what I am doing wrong?
I had a similar error at one point. It was fixed by installing php-xml. Make sure you install what waris said also.
sudo apt-get install php-xml
You need to install some extension i-e:
sudo pear install PHP_CodeSniffer
And also enable the php extensions for composer i-e curl,intl
sudo apt-get update
sudo apt-get install curl php-cli php-mbstring git unzip
extra options:
to install composer globally :
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
I had a similar error at one point. It was fixed by installing php-xml. Make sure you install what waris said also.
first php version
php -v
and
sudo apt-get install <your php version>-xml
It looks like codeSniffer requires squizlabs ^3.0.0.
And it also looks like you need to enable extensions in your .ini files.

Error installing Laravel 5.2 on forge

I am trying to resolve this error, and looking for answer everywhere. I checked and they are all enabled in ini file, and it's giving me error.
Loading composer repositories with package information
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sabre/xml dev-master -> satisfiable by sabre/xml[dev-master].
- sabre/xml dev-master requires ext-dom * -> the requested PHP extension dom is missing from your system.
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-curl.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-gd.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-igbinary.ini
- /etc/php/7.0/cli/conf.d/20-imap.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.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-pdo_pgsql.ini
- /etc/php/7.0/cli/conf.d/20-pdo_sqlite.ini
- /etc/php/7.0/cli/conf.d/20-pgsql.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-sqlite3.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-zlib.ini
- /etc/php/7.0/cli/conf.d/25-memcached.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I was facing the same issue after upgrading to ubuntu 16.04 which by default comes with php7. I was able to resolve it by running the following commands
Run the update comand:
sudo apt-get update
They mycript is missing and needs to be installed:
sudo apt-get install mcrypt php7.0-mcrypt
Run the upgrade command:
sudo apt-get upgrade
Install the php-mbstring which is also missing:
sudo apt-get install php-mbstring
Install the phpunit which is also missing:
sudo apt-get install phpunit
And it worked.

Unable to install laravel 5 on windows via composer

I am trying to get started with laravel on windows and here is the command I tried:
rahul#rahulserver MINGW64 /d/PhpIdeaProjects/LaravelLearning
$ composer create-project laravel/laravel learning-laravel-5
Here is the output I get:
Installing laravel/laravel (v5.0.22)
- Installing laravel/laravel (v5.0.22)
Loading from cache
Created project in learning-laravel-5
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for danielstjules/stringy 1.9.0 -> satisfiable by danielstjules/stringy[1.9.0].
- danielstjules/stringy 1.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16].
- laravel/framework v5.0.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
So how shall I move on and have it working?
The requested dependencies require the php extension mbstring as the error explains.
the requested PHP extension mbstring is missing from your system
So install the extension and it should install flawless.
mbstring is built in the libapache2-mod-php5 package. Run
sudo apt-get install libapache2-mod-php5
For windows environments check your php.ini and uncomment the line ;extension=php_mbstring.dll to extension=php_mbstring.dll - then restart your webserver.

Categories