Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

COACHTHEM's avatar

How can I have homestead as well as local PHP environment working together at the same time on my mac.

I am currently using homestead for laravel applications.. I want to have a separate local PHP ENV on my mac so that I can work on non laravel projects.

I would like to have both the EVN active at the same time..

I am currently using MacOS High Sierra..

I am looking for links that will guide me through the process. Thanks in advance.

0 likes
11 replies
tykus's avatar

I want to have a separate local PHP ENV on my mac

What is preventing you from doing this at the moment>

COACHTHEM's avatar

@tykus I have installed homestead which is working fine.. I am just worried If I install one more local server then that might screw my homestead.. I am worried if ports might conflict with each others.

skoobi's avatar

On the mac you can set as many new sites in your host file and Homestead.yaml file as you want. You can have multiple sites Laravel and non-laravel sites working together.

Homestead.yaml file

ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
natdnshostresolver: off

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/projects
      to: /home/vagrant/code

sites:
    - map: project-1.local
      to: /home/vagrant/code/project-1/public
      type: "laravel"

    - map: project-2.local
      to: /home/vagrant/code/project-2/

and in your hosts

192.168.10.10   project-1.local
192.168.10.10   project-2.local

That way you can access each project by its name.

COACHTHEM's avatar

@skoobi I tried installing magento2 inside homestead but its not loading well. it just redirects to /setup and becomes blank.. so that is the reason I want have have a separate ENV

here is the screenshot https://prnt.sc/kdsy2x

skoobi's avatar

What PHP version are you running?

I know i have php 7.2 running and magento is ok on that. It may be a case of just upgrading/downgrading the php versions to suit.

Heres the php version list for magento Magento Spec

COACHTHEM's avatar

I use PHP 7.1.4

so if I upgrade to 7.2 you think Magento will work for me

skoobi's avatar

Possibly. It does show on the spec that 7.1.* that it should work but it doesnt take long to upgrade or downgrade php versions just to test it out.

COACHTHEM's avatar

@skoobi I am now running my magento2 project on php7.2 by specifying it in .yaml file

sites:
    - map: me.magento2
      to: /home/vagrant/Code/magento2
      php: "7.2"

but still no luck. Magento is still struggling to load.. I doubt it might be the problem with memory allocation for the virtual box.. I have set memory to 2048

ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

Your thought

skoobi's avatar

The next thing i suppose to check is the magento files are ok and downloaded correctly.

COACHTHEM's avatar

I deleted the old copy of magento2 and tried reinstalling but while doing that I get Mcrypt error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for magento/product-community-edition 2.2.5 -> satisfiable by magento/product-community-edition[2.2.5].
    - magento/product-community-edition 2.2.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/7.1/php.ini
    - /usr/local/etc/php/7.1/conf.d/php-memory-limits.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Manjunaths-MacBook-Pro:magento2 manjunathpadolkar$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
Cronix's avatar

I assume you're trying to install this via the host and not on homestead (not ssh'd into homestead). You'll either need to update your local hosts php.ini to enable mcrypt (or install it if you don't actually have it), or download the .zip file of it and unpack it. It will run on homestead as-is, but not your local host (until you include mcrypt)

Please or to participate in this conversation.