-1

I moved to mac os x and i set up the vhost for my laravel project but when i run it tell me Mcrypt PHP extension required. So i used this tuto http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/ and in stalled a new version of php 5.6.11 with mcrypt on it but when i try phpinfo() in a web page it still show me php 5.5.20 version and mcrypt is not running so how do i use my new in stalled version of php to run my project?

Ahmed Karmous
  • 373
  • 2
  • 10
  • 25
  • You may want to consider running in a virtual machine, for example using [Laravel Homestead](http://laravel.com/docs/4.2/homestead). While it is possible to get OS X's PHP set up with mcrypt, install MySQL, and so on, it can be a lot easier just to use a pre-built (and Laravel-official) virtual box. Plus if you switch back to a different OS, you can take it with you... – Matt Gibson Aug 26 '15 at 08:37

1 Answers1

1

You may have two versions of php installed on your Mac. Use the command below to see the current version.

$ php -v

Solution 1

You can change the version by edit the configure file of apache.

vim /etc/apache2/httpd.conf find LoadModule php5_module and change the 'so' to your new php56 you installed.

Solution 2

I recommend you use Homebrew to manage your packages on Mac. (Homebrew: http://brew.sh/)

And this is how to install php56 after installed Homebrew:

install php: $ brew install php56

install mcrypt extension: $ brew install php56-mcrypt

leslie
  • 26
  • 4