MCrypt is missing from your system. OS Yosemite - php

So at work, I've been tasked to learn and start to use some Laravel, so I've been following the documentation and some tutorials on Youtube, but I cannot seem to get it working. I am using composer and MAMP to install Laravel. When I use the command (in the terminal) "composer create-project laravel/laravel TestLaravel" while in htdocs. It quickly comes up with this error:
➜ htdocs composer create-project laravel/laravel TestLaravel
Installing laravel/laravel (v5.0.1)
- Installing laravel/laravel (v5.0.1)
Loading from cache
Created project in TestLaravel
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.0.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[v5.0.0, v5.0.1, v5.0.2, v5.0.3, v5.0.4, v5.0.5].
I was wondering if anyone would have a solution to this problem for me.
Thank you.
Joshua Johnson

Mac OS X Yosemite
the requested PHP extension mcrypt is missing from your system
I fixed this error by running the following commands in my Terminal :
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt

Mostly this problem comes when your MAMP PHP Version not match with command version php. Please have a look in terminal by type php -v then it will show version like php 5.5.*
The problem is you have to set your MAMP PHP Path in ~/.bash_profile like this :
sudo nano ~/.bash_profile
PATH="/Applications/MAMP/bin/php/php5.6.7/bin:$PATH"
That's all, or install mcrypt lib if you want to use your default system php.

The way that I got around this was to install Homestead and make sure to log in to the Homestead Virtual Machine before running any commands. MCrypt is not installed on your local machine, but it is in Homestead.

There's a PHP extension named mcrypt that's often not distributed with stock PHP packages. The mcrypt extension is the defacto standard PHP extension for encryption and hashing functionality. Laravel uses mcrypt.
The built in PHP on OS X does not come with mcrypt installed. This means you either need to
Build and install the mcrypt extension yourself for OS X's built in PHP
Use homebrew to build and install PHP with mycrypt
Use a "pre-compiled for OS X" PHP package.
Use a vagrant virtual machine to run your development stack
I usually chose the third option, and use the lipp.ch package. This is a long running project, and has it's roots in the old entropy.ch packages managed by Marc Liyanage from even further back.

Related

Laravel requires php56-mcrypt, but I can't install php56-mcrypt

I'm trying to get an old Laravel project running, but when I try running composer install, I get this error:
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 laravel/framework v5.0.32 -> satisfiable by laravel/framework[v5.0.32].
- laravel/framework v5.0.32 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
Problem 2
- laravel/framework v5.0.32 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- barryvdh/laravel-ide-helper v2.0.3 requires illuminate/console 5.0.x -> satisfiable by laravel/framework[v5.0.32].
- Installation request for barryvdh/laravel-ide-helper v2.0.3 -> satisfiable by barryvdh/laravel-ide-helper[v2.0.3].
The php executable I'm using is located here:
/usr/local/Cellar/php#5.6/5.6.30_6/bin/php
And I've added extension=mcrypt.so to every php.ini I could find (including one I put at the root of the Laravel project).
I have no idea if this is related (there appears to be a dozen or more php versions scattered throughout my Mac).
So I've been trying to install mcrypt but every answer I've found seems to be outdated. This is what I've tried:
brew install homebrew/php/php56-mcrypt
Output: Error: No available formula with the name "homebrew/php/php56-mcrypt"
brew install php#5.6 -with-mcrypt=mcrypt
This seems to install successfully but doesn't fix the error.
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php56-mcrypt
Output: Error: No available formula with the name "php56-mcrypt"
How am I supposed to install php56-mcrypt on a Mac?
Try with this:- brew install php56-mcrypt --without-homebrew-php
And add this extension in your /private/etc/php.ini :-
extension="/usr/local/Cellar/php56-mcrypt/5.6.x/mcrypt.so"
Edit:- Try adding tap first as follows:- brew tap homebrew/homebrew-php and than run the install command.

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.

ext-mcrypt error while installing laravel on ubuntu 14.04

I am beginner in laravel in ubuntu 14.04.
I try to run this following commend for install laravel.
composer create-project laravel/laravel --prefer-dist
and i got following error.
i am also try to install ncrypt but i got same error.
Installing laravel/laravel (v5.0.1)
- Installing laravel/laravel (v5.0.1)
Loading from cache
Created project in /opt/lampp/htdocs/laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[v5.0.0, v5.0.1, v5.0.2].
i am also try to run this command but i got this same error.
sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
Thanks in advance..
I am open this file
gedit /etc/php5/cli/php.ini
put one line in to this file
extension=mcrypt.so
and this run successfully.
any ways thanks again.
This is how I solved on Mac Yosemite. I have one php.ini in /etc/, and I have mcrypt instaIled. But I faced the same problem.
Run this to find another php.ini.
php -i|grep ini
It returned the followings.
System => Darwin Myname-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Configuration File (php.ini) Path => /usr/local/etc/php/5.5
Loaded Configuration File => /usr/local/etc/php/5.5/php.ini
....
I open /usr/local/etc/php/5.5/php.ini and added extension=mcrypt.so to the file.
I hope this will help someone in future.
Mac users with brew just run in CLI:
brew install php56-mcrypt
Doinion Rings.

I can't install laravel on mac

This is my error, I found it on google, and I don't know where is the error. I have MAMP PRO with php 5.4.4 version
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v4.2.4 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.3 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.2 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.1 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.0 requires php >=5.4.0 -> no matching package found.
- Installation request for laravel/framework 4.2.* -> satisfiable by laravel/framework[v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
OS X is pre-installed with its own PHP, and it's probably older than 5.4 that Laravel 4.2 requires. And when you do php in your terminal, you'll probably get your OSX's php. Try it with php -v
You'll need to make your MAMP PRO's php your default binary, as suggested in change the PHP path to MAMPs PHP Try:
export PATH=/Applications/MAMPPRO/php5.4.4/bin:$PATH
This will only work up until you close your terminal. To make the change permanent, add the line above to your ~/.bash_profile
Then you check again by typing which php to your terminal. It should now point to your MAMP PRO's PHP binary.
Use homestead , its a vagrant box that will help your development.
https://github.com/laravel/homestead
You can set up a virtualbox with debian.
virtualbox: https://www.virtualbox.org
debian: https://www.debian.org
web server install tut:
http://www.howtoforge.com/ubuntu-lamp-server-with-apache2-php5-mysql-on-14.04-lts
or install homestead: http://laravel.com/docs/homestead
And read this: https://www.andrewmunsell.com/blog/development-environments-with-vagrant-and-puppet
Alternatively, if you are comfortable with the terminal, installing Apache & PHP, you can use MacPorts to install any version of PHP >= 5.4.
MacPorts

Installing Sylius

I am installing Sylius. In my command prompt I did
composer create-project -s dev sylius/sylius
I get this error message :
C:\wamp\www\Symfony>composer create-project -s dev sylius/sylius
Installing sylius/sylius (dev-master 18d981683430c0afd1a102b6fc67f8ffeaabddc0)
- Installing sylius/sylius (dev-master master)
Cloning master
Created project in C:\wamp\www\Symfony\sylius
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 symfony/icu 1.2.x-dev -> satisfiable by symfony/icu[1.2.x-dev].
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
Problem 2
- Installation request for instaclick/php-webdriver 1.0.x-dev -> satisfiable by instaclick/php-webdriver[1.0.x-dev].
- instaclick/php-webdriver 1.0.x-dev requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 3
- Installation request for instaclick/php-webdriver dev-master -> satisfiable by instaclick/php-webdriver[dev-master].
- instaclick/php-webdriver dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 4
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/symfony 2.3.x-dev requires symfony/icu ~1.0 -> satisfiable by symfony/icu[1.2.x-dev].
- Installation request for symfony/symfony 2.3.x-dev -> satisfiable by symfony/symfony[2.3.x-dev].
What I tried :
php composer.phar self update
php composer.phar install
Deleting sylius directory
Reinstalling sylius with the create-project command
Fresh installation of Symfony 2.3.4 and reinstallation of sylius
Did what was told in the first answer: enable extension curl and intl
Used the function get_loaded_extension() to confirm that curl and intl are loaded. Well, it is loaded
WAMP has two php.ini files, one for apache and one for CLI. When you click on WAMP tray icon in php modules you can see only modules enabled for apache, and so enabling and disabling modules takes effect only for apache copy of php.ini.
Try enabling curl and intl in X:\path\to\wamp\bin\php\php.ini which is config for CLI (BTW. config for apache is placed in X:\path\to\wamp\bin\apache\bin\php.ini).
It looks like you need to install two PHP extensions to make this work: curl and intl (which provides the lib-icu required by symfony/icu). Since you are using Windows, I recommend the official guide on how to install extensions on Windows systems. You can find the intl extension in the PECL repository here.
curl should be installed on your WAMP already, but disabled by default. See the top answer to this question for instructions on how to enable it.
Sylius has now released the latest version v1.0.0 which I have covered in a blog to install it. Here is the Source: https://www.cloudways.com/blog/install-sylius-ecommerce-framework/
You just need to run the following cammands in SSH or Terminal Sylius will be installed
$ composer create-project -s beta sylius/sylius-standard project
$ cd project
$ npm install
$ npm run gulp
$ bin/console sylius:install

Categories