Platform.sh is a second generation Platform-as-a-Service (PAAS) offering a continuous deployment cloud hosting solution.
Local development environment is handled via Lando. Lando documentation can be viewed here
Before settings up Lando install composer, open a terminal window in the project root and run composer install
. This will install the necessary components in order to continue.
- Save
dorenv-example
as.env
in the same root folder. - Open
.env
file and amend vales. For database credentials please refer to the lando LEMP documentation or use the below:
DB_HOST=database
DB_NAME=lemp
DB_PASSWORD=lemp
DB_USER=lemp
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 /Users/alex.oliver/Desktop/platform.sh-wp-starter
SERVICES appserver_nginx, appserver, database, mailhog
APPSERVER_NGINX URLS https://localhost:32795
http://localhost:32796
http://website-local.lndo.site:8000/
https://website-local.lndo.site/
MAILHOG URLS http://localhost:32794
http://mail.website-local.lndo.site:8000/
To gain access to the database locally use Sequel Pro or another similar application. Use the below connection credentials:
Host: 127.0.0.1
Username: lemp
Password: lemp
Database: lemp
Port: [Port number generated by Lado]
every time a development environment is started Lando will create random port numbers for services such as databases and mailhog. To get retrieve these port number enter the below terminal commands in the project folder:
lando info
Lando will list out useful information on the current running environment. The database port number value can be founf under the external_connection
variable.
If you wish to import a database via the Lando CLI please refer to the official documentation
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 /web/sites/default
to port 80 so source files should be placed here.
A default wp-config.php
has been added to the /web/sites/default
. Do not change or remove this document.
wp-config.php
will automatically load in a file called wp-config-local.php
when using a local development environment. wp-config-local.php
is located in the project root directory. You can amend this file but do no move it.
Lando will also load the MailHog services. This service will catch outgoing mail from the development server.
To access the MailHog GUI navigate your browser to http://mail.website-local.lndo.site:8000 once Lando has completed loading the development environment.