I am trying to run Laravel but I was getting a mcrypt error. I found more than one php on my mac so I decided to delete both and reinstall. However I can not seem to find instructions on how to install the php. Every thing I find already has the php installed and it is instructions on how to make them work by enabling. I need to know how to get it installed.


Any Mac built in the last 10 years comes with Apache and PHP installed and ready to go. All you need to do is run one command to start apache (apachectl start) and un-comment 1-2 lines in httpd.conf. installing massive packages that leave you with multiple copies is NOT necessary.

If you want a friendly interface and a box to check, get Apple's Server application.

| improve this answer | |
  • i need your help if you are there – lewis4u Oct 4 '16 at 13:01

One method is to download MacPorts from https://www.macports.org/install.php. Once done, run the command sudo port selfupdate then sudo port install php56 (which means php5.6. Adapt that for whichever version you need). You can also type port search php56 (or whichever version you chose) to get a list of PHP packages available for that version.

| improve this answer | |
  • I loaded php back using the macports and currently I only get a blank page when trying <?php phpinfo();?> the php module is loaded according to apachectl -M. Where would I look to solve this issue. I have been all over the web trying to fix this issue. – user1088014 Jun 9 '15 at 11:51
  • Got the php running again but now back to where I started when using Laravel: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'. Any ideas – user1088014 Jun 9 '15 at 12:27
  • The sudo install php56-mcrypt @5.6.9 seems to indicate it is already installed with no broken files found. – user1088014 Jun 9 '15 at 12:33

Laravel Homestead is what you need.

Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!

Just have your Vagrant installed, then set up the laravel/homestead box.

| improve this answer | |
  • Note this installs a Virtual Machine in which the setup will run – mmmmmm Jun 9 '15 at 10:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .