lucasbrasantos / carsPHP

carsPHP
1 stars 0 forks source link

Instructions to Run the Project with XAMPP

This guide will walk you through the steps to set up and run your project using XAMPP, which includes Apache for serving PHP files and MySQL for the database.

Step 1: Install XAMPP

  1. Download XAMPP from the official website: XAMPP Download Page.
  2. Follow the installation instructions for your operating system (Windows, macOS, or Linux).
  3. Start the XAMPP Control Panel after installation.

Step 2: Start Apache and MySQL

  1. Open the XAMPP Control Panel.
  2. Start Apache and MySQL by clicking on their respective "Start" buttons. They should turn green once they are running.

Step 3: Set Up the Project Files

  1. Place your project files in the appropriate directory. By default, you can use the htdocs directory inside the XAMPP installation directory. For example:
    • On Windows: C:\xampp\htdocs
    • On macOS: /Applications/XAMPP/htdocs
    • On Linux: /opt/lampp/htdocs
  2. Make sure your project files, including the PHP files, are located in a subdirectory within the htdocs directory.

Step 4: Set Up the Database

  1. Access phpMyAdmin by going to http://localhost/phpmyadmin in your web browser.
  2. Log in with the username and password you set during XAMPP installation (by default, username is root and password is empty).
  3. Create a new database by clicking on the "Databases" tab, entering a name for your database (e.g., cars_php), and clicking "Create".

Step 5: Update Database Connection Configuration

  1. Navigate to the file containing your database connection configuration. This file typically contains the credentials for connecting to the MySQL database.
  2. Update the configuration to use the correct database credentials (host, username, password, and database name). For example:
    $host = "localhost";
    $port = 3306;
    $user = "root";
    $password = ""; // By default, password is empty
    $dbname = "cars_php";
  3. Save the changes to the file.

Step 6: Access Your Project

  1. Open your web browser.
  2. Navigate to http://localhost/your_project_directory. Replace your_project_directory with the name of the directory where your project files are located.
  3. Your project should now be accessible, and you can interact with it through the web interface.

Step 7: Troubleshooting