Local development environment is handled via Lando. Lando documentation can be viewed here
- Save
dotenv-example
as.env
in the same root folder. - Open
.env
file and amend vales. For database credentials please refer to the lando lamp documentation or use the below:
DB_HOST=database
DB_PASSWORD=lamp
DB_NAME=lamp
DB_USER=lamp
Lando configuration can be amended via the .lando.yml
file. For more information on configureing the Lando development environment please refer to the Lando documentation.
If Lando is not installed, head over to Lando documentation for system requirements and installation instructions
Once configured cd into the project directory. Lando can be ran via the below CLI command:
lando start
After a successful start up you should see something similar to the below:
NAME website-local
LOCATION
SERVICES appserver, database, phpmyadmin
APPSERVER URLS https://localhost:50853
http://localhost:50854
http://website-local.lndo.site/
https://website-local.lndo.site/
PHPMYADMIN URLS http://localhost:50852
Access to the instance database can made via the PHPMyAdmin service.
Instructions form importing a database via the Lando CLI can be found on the official Lando documentation. Alternatively enter the below command via the Lando CLI:
lando example-database/lamp.2022-01-18-1642497258.sql.gz
Absolute paths will require amending when creating another site instance. This can be achieved by executing the below SQL queries via the mysql CLI. The below CLI command Drops into a MySQL shell on the Lando database service:
lando mysql lamp
Note: Ensure the OLD_URL and NEW_URL variables are amended with the required URL’s
UPDATE wp_options SET option_value = replace(option_value, 'OLD_URL', 'NEW_URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'OLD_URL','NEW_URL');
UPDATE wp_posts SET post_content = replace(post_content, 'OLD_URL', 'NEW_URL');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'OLD_URL','NEW_URL');
UPDATE wp_options SET option_value = replace(option_value, 'OLD_URL', 'NEW_URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'OLD_URL','NEW_URL');
UPDATE wp_posts SET post_content = replace(post_content, 'OLD_URL', 'NEW_URL');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'OLD_URL','NEW_URL');
By default this repository is setup to use WordPress. However any source files can be added to the project.
The Lando configuration in the repo exposes /public_html
to port 80 so source files should be placed here.
A default wp-config.php
has been added to the /public_html
. Do not change or remove this document.
- SSH into Lando instance:
lando ssh
- CD into public_html folder:
cd public_html
- Install latest WordpRess core files:
php wp-cli.phar core download
Username: site.admin
or [email protected]
Password: zh02iI@cH6p*!RUO(v
It's recommanded to use a external service like mailtrap.io