TuGordoBello
TuGordoBello

Reputation: 4510

How can I install mcrypt without use MAMP software on Yosemite OSX?

I've installed PHP, MySQL, PHPMyAadmin and Apache without Mamp, I used this video and work very good

When I triying to create a new project with composer apper the typical error of mcrypt required

but in console

MacBook-Pro-de-zhelon:~ zhelon$ brew install mcrypt
Warning: mcrypt-2.6.8 already installed

And

    MacBook-Pro-de-zhelon:~ zhelon$ which php
    /usr/bin/php
    MacBook-Pro-de-zhelon:~ zhelon$ 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)

I am not usugin MAMP software

How can it?

Upvotes: 0

Views: 468

Answers (1)

Chris Schmitz
Chris Schmitz

Reputation: 20980

Two things you may consider:

homebrew

Homebrew is a package manager for the mac os. It's similar to tools for linux like apt-get or yum. Basically, it's a tool that will help you install and configure applications for your computer that are mostly used for development.

With homebrew you can run the following commands to search for and install the mcrypt extension for your version of php:

brew search mcrypt
#outputs: libtomcrypt   mcrypt      php53-mcrypt  php54-mcrypt  php55-mcrypt  php56-mcrypt

brew install php55-mcrypt

After homebrew has finished installing it will give you instructions for you to link mcrypt to your php instance (adding it to your php.ini file).

You can even use homebrew to install php itself if you want a new version.

All of that said, if you're working on laravel projects I would strongly suggest you explore the next option.

homestead

Laravel Homestead is the official laravel supported virtual machine powered by Vagrant. There are a couple of main advantages to using homestead:

  1. Your development environment is independent from your local OS.

This means when you update your OS, uninstall some tools, add some new ones, none of it will affect your development environment

  1. It allows you to "reset" your environment without worry.

If you screw up your local mamp setup you're going to have to dig around and figure out what broke so you can un-break it. With homestead (and really virtual machine development environments in general), if you goof something up in your virtual machine config you can either re-provision it (meaning vagrant will set your machine up over again according to the specs that homestead dictactes) or you could destroy it completely and create it again. Either way your local environment isn't affected.

  1. The tools are already installed for you.

Homestead comes with mcrypt already installed along with plenty of other software you'd need for developing web applications.

My suggestion would be to watch this Laracasts episode on Homestead. Jeffery walks you through the process setting up homestead. Once you have it up and running you'll be golden.

UPDATE

I should also mention that homestead is just a virtual development environment, not a laravel-only tool. You can use homestead for other web projects as well.

Upvotes: 1

Related Questions