Difficulty: Beginner
Estimated Time: 10 minutes

Welcome to Bitnami's Apache and MySQL troubleshooting guide!

In this guide, you will learn, step by step, how to troubleshoot and resolve Apache and MySQL problems with your Bitnami applications.

This guide uses a Bitnami LAMP image containing a PHP script that is deliberately broken. Over the next few steps, you will follow some basic troubleshooting steps to identify the errors and resolve them to produce a functioning result. Although this is a contrived example, the principles shown here can be applied to debug Apache and MySQL issues on any Bitnami image.

Assumptions and prerequisites

  • You have the public IP address of your instance.
  • You have the necessary SSH key pair to log in to your instance (more information).
  • You have the database root password for your instance (more information).

We want to hear your feedback so we can keep improving our content. Please fill this quick survey and let us know your thoughts.

You can also visit our Community site and ask any questions you may have about SSL configuration on Bitnami stacks.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Troubleshoot Apache and MySQL errors

Step 1 of 5

Check the Apache logs

The PHP script in this example should connect to the MySQL database, retrieve a list of records and display them as a Web page. Use the command below to access it:

curl http://localhost/example.php

As you can see, there is no output displayed. This implies that there was an error in the script. To locate and resolve the error, follow the steps below:

  1. Check the Apache error log:

    sudo tail /opt/bitnami/apache2/logs/error_log

    You will see that the source of the error is a syntax error on line 6 of the script.

  2. Check the PHP script. You can use your preferred editor. This example uses nano.

    sudo apt-get install nano

    sudo nano /opt/bitnami/apache2/htdocs/example.php

    You will see that there is a missing semi-colon at the end of line 5. Add this to resolve the syntax error and save the file.

Continue to the next step to see if this resolves the error.