This docker application provides a worked example of how to install BugSnag into a wordpress installation.
Try this out with your own BugSnag account!
Create a .env file in the root of this directory. This file should specify two passwords:
MYSQL_PASSWORD="your-password-here"
MYSQL_ROOT_PASSWORD="your-root-password-here"
These are used to setup the WordPress database on the MYSQL server.
Start the docker application using:
docker-compose up -d
Once the application is running navigate to http://localhost:8080 and follow the on-screen instructions to finalize the settings of your local wordpress application.
First BugSnag needs to be added to your WordPress app. This can be accomplished in one of two ways:
- Inside the admin dashboard of your WordPress app, navigate to the
Pluginssection. - From there, select the
Add Newbutton next to thePluginstitle. - Search for
Bugsnagin theSearch plugins...search field in the top right. - Select
Install Nowon the plugin titledBugSnag Error Monitoring pluginByBugSnag
- Visit the WordPress plugin index and search for
bugsnag. - Download the BugSnag ZIP file and unzip it.
- Move the
bugsnagfolder from the unzipped file to theapp/wp-content/pluginsfolder.
On your WordPress admin dashboard visit the Plugins section. In the list of plugins, find BugSnag Error Monitoring plugin and press activate.
Once activated, press settings and enter your BugSnag API key in the resulting screen.
You can test your installation by sending an example notification from your WordPress app to BugSnag using the Test BugSnag button on the settings page.
For more information, see our documentation: https://docs.bugsnag.com/platforms/php/wordpress/
The docker-compose file in this example exposes the /var/www/html/ folder of the WordPress app within the app folder in this directory. This allows you to easily modify various aspects of your WordPress installation and see the result instantly on your local machine.