-
Notifications
You must be signed in to change notification settings - Fork 10
Installing with MAMP
This documentation is deprecated/obsolete. Lute v2 has been replaced by Lute v3, a full Python rewrite. Please see the Lute v3 manual which includes notes on installation. If you have Lute v2, you can easily migrate to v3. Thank you!
- download MAMP https://www.mamp.info/en/downloads/
- run the installer (it's both MAMP and MAMP PRO, but you'll only use MAMP)
- Lute requires at least PHP 8.1, but as of now MAMP comes with max version 8.0.8. I think there are a few ways to get v 8.1, but the clearest set of instruction I found was from https://gist.github.com/codeadamca/09efb674f54172cbee887f04f700fe7c. Copied below:
- if you don't have
homebrew
already, get it: https://treehouse.github.io/installation-guides/mac/homebrew - install PHP v.8.1 on your system, outside of MAMP, using homebrew (https://formulae.brew.sh/formula/php):
brew install [email protected]
- using Finder, Menu > Go > Go to Folder
/usr/local/Cellar/php
, and copy the right folder (for me, it was 8.1.13). - using Finder, Go to Folder
/Applications/MAMP/bin/php
. There will be a bunch of php folders in there; paste the folder you just copied. Addphp
to the start of the folder name (e.g.php8.1.13
) so it follows the naming convention of the others.
- if you don't have
- Go to Folder
/usr/local/lib/httpd
. Copy themodules
folder. - Go to Folder
/Applications/MAMP/bin/php/
, and paste themodules
folder inside thephpXXX
folder you just created (e.g.php8.1.13
) - Close and restart MAMP, and you should be able to pick version
php8.1.13
in the dropdown.
- Go to Folder
/usr/local/lib/httpd/modules
. That folder containslibphp.so
, so you might think you've copied that file to MAMP in the prior step ... but unfortunately, that's not the case! That file is potentially just a shortcut to another file, and Apache doesn't like that. Cue single tear. - Right click
libphp.so
, and click "Show original." Copy that file. - Go to Folder
/Applications/MAMP/bin/php/php8.1.13/modules
, and paste the goodlibphp.so
file you just copied, replacing the oldlibphp.so
.
You can get Lute into the htdocs
folder in MAMP in one of two ways:
- If you're a software person: Clone the git repo inside the
htdocs
folder in MAMP (Applications/MAMP/htdocs), usecomposer install --dev
to install all the dependencies, and then create an.env.local
file, using.env.local.example
as a template. - If you're a regular human :-) get the latest lute_release.zip, and unzip it inside of
htdocs
. When you unzip the file, yourhtdocs
folder should contain alute_release
folder.
The structure should be as follows:
- Applications
- MAMP
- htdocs
- lute (or lute_release)
.env
.env.local
...
+ bin
+ config
+ db
... etc.
Next, we need to change MAMP to that it's serving LWT from the root folder.
In Menu > MAMP > Preferences > Server tab, for the Document Root, click "Choose", and select "Applications/MAMP/htdocs/lute/public" as the document root.
Note: if you're already running other sites on MAMP, you can add Lute as a Virtual Host. I'll assume you already know how to do this, and how to update your
/etc/hosts
.
In your editor, open the file /Applications/MAMP/conf/apache/httpd.conf
. This is the main Apache configuration file.
In this file, there will be a long list of lines starting with "LoadModule". Ensure that the libphp.so
file is referenced in this list, it will be a line like the following:
LoadModule php_module /Applications/MAMP/bin/php/php8.1.13/modules/libphp.so
Update the User to your computer username. You can get that via terminal with id -un
. For me, that returned jeff
, so I have:
User jeff
A few lines down from User
, you'll see this:
DocumentRoot "/Applications/MAMP/htdocs/lute_release/public"
That was the change you made earlier in MAMP preferences. fyi only.
Change
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
to:
<Directory />
AllowOverride none
Require all denied
</Directory>
Change Options All
to Options Indexes FollowSymLinks MultiViews
In the file /Applications/MAMP/htdocs/lute_release/.env.local
, set the DB_HOSTNAME exactly as follows:
DB_HOSTNAME=127.0.0.1:8889
THE LINE MUST BE EXACTLY AS ABOVE. If it is anything else (localhost, localhost:8889, 127.0.0.1), it won't work! Unfortunately, I haven't had time to figure out why ... and I'm not sure I care, really. 127.0.0.1:8889 works and is stable!
Leave the rest of the settings as-is. (MAMP uses username=root, password=root as the defaults, so the values set in the .env.local are fine, and Lute will set up the lute_demo database when it starts up).
All of the above might have felt pretty hairy -- hopefully not.
(if it bombs with an "Apache can't start" error, try starting it from the command line:
/Applications/MAMP/Library/bin/apachectl start
The above might give you more information on what is wrong.
And hopefully everything is hunky-dory. :-)
- If you find any errors in this wiki, please open a GitHub issue
- Join us on Discord