Configure the database connection

In VSCode, open the public folder, e.g. ~/Local Sites/vmgd/app/public/wordpress

In the root folder, copy wp-config-sample.php to wp-config.php

In wp-config.php make the following changes:

  • Set DB_NAME -> local

  • Set DB_USER -> root

  • Set DB_PASSWORD -> root

Copy and paste the following lines near the end of the file:

define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); define('FS_METHOD', 'direct'); define('REPLACE_IMAGE_URL', 'https://content.vmgd.gov.vu');

This will enable wordpress to write to the wp-content/debug.log file so you can view any wordpress errors/warnings. FS_METHOD setting allows you to install/update plugins.

The REPLACE_IMAGE_URL setting means that all images will be fetched from the live server so you don't have to download all the files to your local machine.

Now you go back to local program and hit open site. You will be redirected to:

If it says database update required hit update.

Login using the credentials you specified when creating the site, hopefully:

Username: admin

Password: admin

You should see the dashboard:

Last updated