After fiddling with MAMP and its installation of PHP as global for scripts in terminal/console for hours I gave up with the somehow logic instructions for MAMP installations, as I was unable to upgrade the laravel/installer.
# install dependencies
brew install autoconf # required by pecl
brew install libzip
# install zip extenion in your selected MAMP PHP version
pecl install zip
# edit php.ini in your selected MAMP PHP version
echo "extension=zip" >> php.ini
What worked for me was to install PHP on my macos with HomeBrew and link/add it to the $PATH.
brew install email@example.com
echo 'export PATH="/firstname.lastname@example.org/bin:$PATH"' >> .bash_profile
echo 'export PATH="/email@example.com/sbin:$PATH"' >> .bash_profile
Restarted an older project in Laravel. To my surprise there were no major headaches.
Just the time to setup my new favorite tool: Visual Studio Code. A great way to develop and debug for PHP inside or outside of containers.
Just in the middle of the first debug session Laravel drops an error: Exception has occurred. Illuminate\Contracts\Encryption\DecryptException: The payload is invalid.
A quick google finds out the page on: https://stackoverflow.com/questions/47355311/laravel-5-with-xdebug-always-throws-the-payload-is-invalid
Tried both methods and both work.
The correct solution is to just add the “XDEBUG_SESSION” cookie to the exceptions array in the
* The names of the cookies that should not be encrypted.
* @var array
protected $except = [
But I preffer:
If the answer doesn’t work, try adding this into launch.json
"name": "Listen for XDebug",
Because that way the Xdebug cookie exception does not make it to the production app and security is maintained.
the key is to install PHP-Debug extension in Visual Studio Code, configure MAMP to use Xdebug. Let VSCode create a .vscode/launch.json file automatically and start your debugging session. Depending on the version of VSCode the button in the debugger window may be labeled differently or placed elsewhere.
It just works.