Skip to content

Setup (Windows)

Tpatel313 edited this page Jul 18, 2023 · 4 revisions
  1. Install GitHub Desktop and PHPStorm. (Make sure you apply for a student license).

  2. Install Git.

  3. Install WAMP (which will hopefully install both MySQL and PHP) and open it.

  4. Create a GitHub account (if you don't have one already), and log into it in GitHub Desktop.

  5. Clone this repository locally by either:

    • using the command line: running git clone https://github.com/RamblinReckClub/website.git)
    • using GitHub Desktop:
      • click the leftmost tab of the top bar
      • click the "Add" dropdown
      • click "Clone Repository..."
      • find this repository in the list
      • configure where you want this repo to live on your hard drive via "Choose..."
      • hit "Clone".
  6. Configure PHPStorm to recognize your PHP installation.

    • Open PHPStorm.
    • Open Settings (older version could be preferences) by clicking on the File menu in the top left of the window and selecting settings (or preferences) from the dropdown.
    • Once open, navigate to Languages & Frameworks.
    • Select PHP from the dropdown.
    • Click the ... button at the end of the line that says "CLI Interpreter".
    • Verify that the PHP executable field states C:/wamp64/. If not (or that's not where your PHP installation is located), click the folder button in that field and navigate to where your PHP installation is.
      • If PHP Storm does not detect your PHP file, you'll need to find the file path on your own. Ours was C:\wamp64\bin\php(pick a version, ours had 3)\php.exe
    • Hit "Apply" to save your changes, then "OK" to close that window. Hit "OK" again to close the Preferences window.
  7. Configure the local development environment in PHPStorm.

    • In the top right of the PHPStorm window, there will be a dropdown field next to a grayed out play button. Click that and select "Edit Configurations..." (could also be Add Configurations)
    • Click the "+" button in the top left of the resulting window. Select the "PHP Built-in web server" option from the dropdown.
    • Edit this Run Configuration as follows:
      • Set the name to "deploy" (for sake of uniformity).
      • Verify that the document root is where this repo is located on your computer.
      • Ask the previous tech chair for the site's environment variables. Input these into the Environment Variables field, making sure to change any emails to your own.
      • Take note of the host and the port (you'll navigate to the address they create to view the site).
    • Once done editing, click "Apply" to save your changes, then "OK" to close the window.
  8. To configure database access, there are two main steps:

    • In your browser:

      • Note: This first step is exporting the database tables. This export needs to be done by the previous technology chair and then sent to the new chair (by email works), or the new technology chair needs to be added to the reck club site at hosting.gatech.edu so that he/she can download the tables.
      • Navigate to hosting.gatech.edu and log in.
      • Click on "Plesk Web Admin" in the top bar.
      • On the resulting page, click on "reckclub.org.gatech.edu" on the table on the left side of the page. This will open Plesk.
      • When Plesk loads, click the "Databases" tab on the left side.
      • Scroll down to the database titled "reck_club".
      • Click "phpMyAdmin".
      • Click the "Export" tab.
      • On this tab, use the "Quick" settings option and click "Go" at the bottom of the page.
      • This will download a SQL file called reck_club.sql to your Downloads folder.
    • In PHPStorm:

      • Open the "Database" tab from the right side of your window (it should be minimized by default).
      • Click the "+" button, select "Data Source", and then select "MySQL" in the dropdown.
      • Set this data source's name as "@localhost" and verify that the host set for it is localhost and the port provided matches the port that MAMP is running on. (You can check MAMP's ports by opening MAMP, clicking on "WAMP" in the top left of your screen, clicking "Preferences", clicking the "Ports" tab in the resulting window, and finding the "MySQL Port" field.)
      • Set the "User" and "Password" fields to "root" (this is the default configuration for MySQL).
      • Verify that the URL reads something like jdbc:mysql://[host]:[port]. Test the connection. If it doesn't work, check if WAMP is running and verify your ports again.
      • Once the connection has been tested, click "Apply" to save your changes and "OK" to close that window.
      • Back in the "Database" tab, right-click "@localhost" and then click the "new" option in the drop down. Select "Schema" from the dropdown.
      • In the resulting window, set the name of the schema to "reck_club" and click "Execute".
      • Back in the Database tab, right-click "reck_club" and select "Run SQL Script...".
      • Find the previously-downloaded reck_club.sql on your hard drive and select it.
      • When you hit "Open", the "Database" tab should now populate with all of the tables from the live site under "reck_club".
  9. Run the site locally by clicking the green play button next to "deploy" in the top right of your PHPStorm window. Navigate to [host]:[port] (by default, this should be localhost:80) in a browser window. Verify that you can see the public website.

  10. Navigate to [host]:[port]/points.php. Log in using your RRC credentials from the live site. Verify that you can see points data.

    • If you can not see points data or get a PHP error message:
      • Open PHPStorm and open "database_connect.php" from the file list on the left side.
      • If you had to change the password to MySQL in step 8, make sure to update those passwords here as well.
      • Change the variables to match the configuration you set up in Step 8.
      • Open "memberLogin.php" from the file list on the left side.
      • Comment out lines 56 and 63, and uncomment lines 58 and 62.
      • Re-launch the site by using the green play button next to "deploy" in the top right of your PHPStorm window.
      • The steps above should make it so that you are redirected after logging in. However, it just might not, keeping you stuck on "memberLogin". In this case, change the URL to "points.php" to see if everything actually works.
  11. Be prepared that there could be warning messages all over your screen. The reason is that newer versions of PHP prefer you to put single quotes around your variables names. The site is written without these single quotes. If you read the error messages carefully, you can see these are just warnings that can be ignored easily.

Clone this wiki locally