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

Chrizzmeister's avatar

Laraval .env xamp & mamp pro working together

i'm using github in combination with laraval for the first time.

I have 2 local environments :

  • a) i use MAMP Pro for local development (Mac)
  • b) i use XAMPP for local development (Windows)

I made a new repository and pushed to github on environment a) , I cloned this repository on setup b) and added a .env file to setup my database. However i'm a bit confused what to do with the app_key value, do i need to just copy it form my initial environment? or need a new one?.

The second part of my question is that i seem to have problems with xampp vs mamp pro because they rewrite a couple of urls, wich means my project won't run on environment b). Are there other settings i need to adjust? and will it brake again if i commit on environment b) ?

Error message when running the project on environment b)

Warning: require(D:\dev.local\ADifferentDesign\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in D:\dev.local\ADifferentDesign\bootstrap\autoload.php on line 17

Fatal error: require(): Failed opening required 'D:\dev.local\ADifferentDesign\bootstrap/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in D:\dev.local\ADifferentDesign\bootstrap\autoload.p

 

I'm really confused , i saw other questions like this but none are quite what i was looking for.

Steps for doing this right the next time would also be greatly appreciated

0 likes
1 reply
Chrizzmeister's avatar

i got an answer on the first part on stackoverflow from the user BrokenBinary:

If you are sharing any resources that hold encrypted data between the two environments, like a database, then you must copy the app_key. This is because laravel uses the app_key whenever it encrypts something like a user's password or a session ID. If you don't need to share a database, sessions, etc then you can and should generate a new key for every environment.

This is a good answer on the first part of the question, but the second part is still unanswered

Please or to participate in this conversation.