However, because you are a developer and developers never ever RTFM here is an example of using the LAMP recipe to run a CodeIgniter project. Note that CodeIgniter could be any other php framework or your own custom php thing.

Configuration

Here are the configuration options, set to the default values, for this recipe. If you are unsure about where this goes or what this means we highly recommend scanning the recipes documentation to get a good handle on how the magicks work.

Choosing a php version

You can set php to any version that is available in our php service. However, you should make sure that whatever framework or custom code you write is designed to work with your choice.

Here is the recipe config to set the LAMP recipe to use php version 5.3

recipe: lamp
config: php:'5.3'

Choosing a database backend

By default this recipe will use the default version of our mysql service as the database backend but you can also switch this to use mariadb or 'postgres' instead. Note that you can also specify a version as long as it is a version available for use with lando for either mysql, mariadb or postgres.

If you are unsure about how to configure the database we highly recommend you check out the mysql, mariadband 'postgres' services before you change the default.

Using MySQL (default)

recipe: lamp
config: database: mysql

Using MariaDB

recipe: lamp
config: database: mariadb

Using Postgres

recipe: lamp
config: database: postgres

Using a custom version

recipe: lamp
config: database: postgres:9.6

Using xdebug

This is just a passthrough option to the xdebug setting that exists on all our php services. The tl;dr is xdebug: true enables and configures the php xdebug extension and xdebug: false disables it.

Using custom config files

If you do this you must use files that exists inside your applicaton and express them relative to your project root as below.

Note that the default files may change based on how you set both ssl and via. Also note that the vhosts and server config will be explicitly for apache. We highly recommend you check out the apache if you plan to use a custom vhosts or server config.

A hypothetical project

Note that you can put your configuration files anywhere inside your application directory. We use a config directory in the below example but you can call it whatever you want such as .lando.

Connecting to your database

Lando will automatically set up a database with a user and password and also set an environment variables called LANDO INFO that contains useful information about how your application can access other Lando services.

Here are is the default database connection information for a LAMP site. Note that the host is not localhost but database.

You can get also get the above information, and more, by using the lando info command.

Importing Your Database

Once you've started up your LAMP site you will need to pull in your database and files before you can really start to dev all the dev. Pulling your files is as easy as downloading an archive and extracting it to the correct location. Importing a database can be done using our helpful lando db-import command.

You can also run lando from inside your app directory for a complete list of commands which is always advisable as your list of commands may not 100% be the same as the above. For example if you set database: postgres you will get lando psql instead of lando mysql.