Support the ongoing development of Laravel.io →
Installation
Last updated 2 years ago.
0

MAMP doesn't use the PHP at /usr/bin/php, it uses its own somewhere in /Applications/MAMP/bin/php. Is your phpinfo from MAMP showing that it's enabled?

And no, MAMP ships with its own PHP, so an OS upgrade probably isn't related.

Last updated 2 years ago.
0

What is the output of the following commands in your terminal:

which php
php --ini
php -v

Tip: switch to Vagrant.

Last updated 2 years ago.
0

Yes, the php info I'm referring to is the one I accessed through MAMP's start page. Also, that php info page says it's using version 5.4.10

Last updated 2 years ago.
0

Ah, I'm guessing composer is trying to use the OS's PHP, which doesn't seem to have mcrypt installed (or I'd guess, from all the questions about it on the old laravel forums and on stackoverflow). Maybe check this thread or this SO thread?

Last updated 2 years ago.
0

@renege:

which php

/usr/bin/php

php --ini

Configuration File (php.ini) Path: /etc
Loaded Configuration File:         (none)
Scan for additional .ini files in: /Library/Server/Web/Config/php
Additional .ini files parsed:      (none)

php -v

PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Last updated 2 years ago.
0

I alias MAMP's php in my ~/.bash_profile script (your version might be different to 5.4.19)

alias php='/Applications/MAMP/bin/php/php5.4.19/bin/php'

(restart terminal window after applying this)

then check mcrypt with

php -i | grep mcrypt

and look for

mcrypt support => enabled
Last updated 2 years ago.
0

Martinhearn's solution should work. Alternatively, since you have access to Laracasts, check out the tutorial on using Vagrant. I've been using Vagrant exclusively and it's really benefited my team. Knowing that everything's being built from the ground up in its own little VPS ensures that whacking around in OS X or MAMP won't change any of my code.

It's a bit of an involved process (though it's definitely not too hard); I initially did it because I was too lazy to upgrade MAMP, and it ended up replacing MAMP entirely!

Last updated 2 years ago.
0

@martinhearn

I tried this and after running php -i | grep mcryt, I saw that mcrypt support => enabled.

So far, so good.

But I still get the same error when I try to create a new project

Last updated 2 years ago.
0

@rizqidjamaluddin Thank you. If I may end up checking Vagrant out if I can't resolve this with one of the other solutions.

Last updated 2 years ago.
0

ah for Composer to work add MAMP to your path in .bash_profile

export PATH="/Applications/MAMP/bin/php/php5.4.19/bin:$PATH"

(put this at the bottom)

this is because composer calls php using env it it will stop at the first php it comes across which will likely be the Mac default install

#!/usr/bin/env php
Last updated 2 years ago.
0

Hrrmmm...it's still not working. Here's what I'm doing:

open -a "TextEdit" .bash_profile

These are the contents of that file:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a    function*
export PATH=/usr/local/bin:$PATH

I added this to the very end of the file:

export PATH="/Applications/MAMP/bin/php/php5.4.10/bin:$PATH"

Notice I wrote "php5.4.10" instead of "php5.4.19" because my MAMP installation is using 5.4.10

php -v still returns php 5/4/17 which php returns /usr/bin/php

Last updated 2 years ago.
0

php -v still returns php 5/4/17 which php returns /usr/bin/php

did you restart Terminal / launch a new login instance?

Last updated 2 years ago.
0

@martinhearn: Yes, I did

Last updated 2 years ago.
0

I think I finally got it. Instead of adding this to my .bash_profile:

export PATH="/Applications/MAMP/bin/php/php5.4.10/bin:$PATH"

I added this:

export MAMP_PHP=/Applications/MAMP/bin/php/php5.4.10/bin
export PATH="$MAMP_PHP:$PATH"

Just tested it out and I was able to get the welcome screen served up on localhost:8000.

Hurray! Thanks to all of you--and especially Martin Hearn--for your very kind and generous help. I couldn't have done it without you!

Yay, Laravel community!!!!

Last updated 2 years ago.
0

I had the same problem in my environment (Linux Mint 16). Installing php5-mcrypt doesn't automatically enable the module, so I had to enable it manually:

First install php5-mcrypt

apt-get install php5-mcrypt

Create an auxiliary symlink and enable the module:

cd /etc/php5/mods-available
ln -sf ../conf.d/mcrypt.ini .
php5enmod mcrypt

Finally, reload apache2 configuration:

service apache2 reload
Last updated 2 years ago.
0

saul-lopez said:

I had the same problem in my environment (Linux Mint 16). Installing php5-mcrypt doesn't automatically enable the module, so I had to enable it manually:

First install php5-mcrypt

apt-get install php5-mcrypt

Create an auxiliary symlink and enable the module:

cd /etc/php5/mods-available
ln -sf ../conf.d/mcrypt.ini .
php5enmod mcrypt

Finally, reload apache2 configuration:

service apache2 reload

Works like charm , thank you very much

Last updated 2 years ago.
0

Thanks to this post I was able to successfully solve the mcrypt error that I was getting and I am making progress. However, my routes still don't seem to be working.

I have a Projects folder and I created my "luna" project inside of it

When I go to http://localhost:8888/luna I get an index of Luna project.

I updated the route.php file to:

Route::get('my/page', function(){ return 'Hello World'; ]);

and tried to navigate to http://localhost:8888/luna/my/page but get a 404.

I tried navigating to http://localhost:8888/luna/public/ and I get an "oops something went wrong" error page.

Any ideas what is going on?

Last updated 2 years ago.
0

A really simple option which worked for me: http://topicdesk.com/downloads/mcrypt/mcrypt-download

Last updated 2 years ago.
0

brianeoneill said:

I think I finally got it. Instead of adding this to my .bash_profile:

export PATH="/Applications/MAMP/bin/php/php5.4.10/bin:$PATH"

I added this:

export MAMP_PHP=/Applications/MAMP/bin/php/php5.4.10/bin export PATH="$MAMP_PHP:$PATH"

Just tested it out and I was able to get the welcome screen served up on localhost:8000.

Hurray! Thanks to all of you--and especially Martin Hearn--for your very kind and generous help. I couldn't have done it without you!

Yay, Laravel community!!!!

Thanks this worked for me too !

Last updated 2 years ago.
0

Hello community, I am trying to install Laravel 4 under linux using XAMPP server but it seems that I'm having issues with Mcrypt PHP extension. I have tried many solutions but none of them worked!

Any suggestions please?!

Thank you!

Last updated 2 years ago.
0

Try this if you're running on Ubuntu

sudo php5enmod mcrypt

Found it here. Look for astar's comment.

Hope it helps!

Last updated 2 years ago.
0

Here is a solution to install Mcrypt on your Windows, Linux, Mac Pcs' .

read more here.

http://www.kvcodes.com/2014/07/laravel-requires-mcrypt-php-extension/

Last updated 2 years ago.
0

In my case, I had updated to MAMP Pro 3, which updated my version of PHP to 5.5.10. So I had to update the version in .bash_profile to the same:

export PATH="/Applications/MAMP/bin/php/php5.5.10/bin:$PATH"

Last updated 2 years ago.
0

Sometimes this can be fixed on Mac OS X by downloading and building php-mcrypt from scratch. Here are two useful guides:

http://digitizor.com/2014/06/29/build-install-php-mcrypt-mac-os-x-manually/

and

http://digitizor.com/2014/06/29/fix-mcrypt-php-extension-required-laravel/

Last updated 2 years ago.
0

@brianeoneill 's method will work most of the time.

Last updated 2 years ago.
0

martinhearn said:

ah for Composer to work add MAMP to your path in .bash_profile

export PATH="/Applications/MAMP/bin/php/php5.4.19/bin:$PATH"

(put this at the bottom)

this is because composer calls php using env it it will stop at the first php it comes across which will likely be the Mac default install

#!/usr/bin/env php

@martinhearn

Im stuck with this thing.. After I added in bash_profile the following :

export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH

I cant access via global the command 'composer'. When I type 'which php' it refers correctly to MAMP's php version.

When I type 'composer' in command line I get this: env: php: Argument list too long

Who can help me with this? [frustrated]

I'm using MAMP 3.0.6 on MAC OSX 10.9.4

Last updated 2 years ago.
0

vicca said:

martinhearn said:

ah for Composer to work add MAMP to your path in .bash_profile

export PATH="/Applications/MAMP/bin/php/php5.4.19/bin:$PATH"

(put this at the bottom)

this is because composer calls php using env it it will stop at the first php it comes across which will likely be the Mac default install

#!/usr/bin/env php

@martinhearn

Im stuck with this thing.. After I added in bash_profile the following :

export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH

I cant access via global the command 'composer'. When I type 'which php' it refers correctly to MAMP's php version.

When I type 'composer' in command line I get this: env: php: Argument list too long

Who can help me with this? [frustrated]

I'm using MAMP 3.0.6 on MAC OSX 10.9.4

My problem has been fixed by updating MAMP to 3.0.6 with PHP version 5.5.14 [aarghhh]

Last updated 2 years ago.
0

View this videos (https://www.youtube.com/watch?v=oGnlu6VLDVs ) or just read this article (http://www.w3itexperts.com/how-to-install-laraval-laravel-part-1-installation/) i think you get the help about how to install laravel in widow xampp

Last updated 2 years ago.
0

For those using newest php version. I had the same problem with mcrypt.

How solved?

First update MAMP to the newest version. Update you PHP to the same version. Got on both 5.6 stable.

If you check

php -v

you will still get old version becasue php updgrade does not change names on your local mac.

Then change .bash_profile to

export PATH=/usr/local/php5/bin:$PATH
Last updated 2 years ago.
0

I had this problem too. For me, it came down to the order in which I had MAMP's version of PHP mapped in my .bash_profile vs. the system version in /usr/bin. Moving the MAMP path to the start of the PATH statement instead of tacking it on at the end ensured that the expected version of PHP was being used in the terminal.

Last updated 2 years ago.
0

Hey Guys,

The solution to this problem is in the error message: Mcrypt php extension required. That's because osx doesn't ship with mcrypt out of the box. You just gatta install it.

Most of the replies in the thread give a solution (and installing MAMP and aliasing php to it is another approach as well), but the fastest way for me was using homebrew. For anyone who's interested, this is how:

  • First find your php version (terminal command): php -v
  • then install homebrew and configure it using the download link: HomeBrew Installation Link
  • then do a simple search using homebrew (terminal command): brew search mcrypt
  • then select the mcrypt version for your php version (on mine it was php version 5.5) (terminal command): brew install php55-mcrypt

Keep your eye open for any errors, and resolve them with brew's suggestions (I had some folders that had to be given premissions).

Last updated 8 years ago.
0

martinhearn said:

ah for Composer to work add MAMP to your path in .bash_profile

export PATH="/Applications/MAMP/bin/php/php5.4.19/bin:$PATH"

(put this at the bottom)

this is because composer calls php using env it it will stop at the first php it comes across which will likely be the Mac default install

#!/usr/bin/env php

Thanks !

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.