Difficulty: Beginner
Estimated Time: 10 minutes

Welcome to Bitnami's PHP/MySQL application deployment guide!

In this guide, you will learn, step by step, how to deploy a custom Apache/MySQL/PHP application on a Bitnami LAMP instance.

This guide uses a Bitnami LAMP image launched on a cloud instance and an example PHP/MySQL application from GitHub. The same steps apply to other Bitnami images too. Check the Bitnami application catalog to quickly find and deploy other Bitnami images on the cloud.

Assumptions and prerequisites

  • You have the source code of the PHP/MySQL application you wish to deploy.
  • 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.

Deploy a custom PHP/MySQL application

Step 1 of 5

Get the application source code

This guide uses a simple PHP/MySQL example application from GitHub. However, the general principles described will apply to any custom PHP/MySQL application.

Begin by installing Git and downloading the application source code from GitHub. If your application source code is stored elsewhere, you can also transfer it to the instance using SFTP, email or any other transfer mechanism.

  1. Check that all services are running:

    sudo /opt/bitnami/ctlscript.sh status

    At this point, all services should be running. Confirm this by clicking the "Web site" tab in the interactive editor on the right. This should launch a new browser window that displays the LAMP index page.

  2. Install Git and a text editor. This example uses nano but you can use any editor that you prefer:

    sudo apt-get install git

    sudo apt-get install nano

  3. Create the necessary directory structure for the application. In this guide, the example application will be stored in the /opt/bitnami/apps/myapp directory.

    sudo mkdir /opt/bitnami/apps/myapp

    sudo mkdir /opt/bitnami/apps/myapp/htdocs

    sudo mkdir /opt/bitnami/apps/myapp/conf

  4. Change to the application directory and clone the application source code repository:

    cd /opt/bitnami/apps/myapp/htdocs/

    sudo git clone https://github.com/chapagain/crud-php-simple.git .

In the next step, you will create a MySQL database and user account for the application, and update the application source code with the necessary access credentials.