-
Notifications
You must be signed in to change notification settings - Fork 3
Setup (Mac)
Mac
-
Install GitHub Desktop and PHPStorm. (Make sure you apply for a student license).
-
Install homebrew, then Git from homebrew. Your machine may come with Git pre-installed -- you can check this by opening up a Terminal window, typing in
git
, and hitting enter (for future reference, this is called "running git"). If you see a large block of text explaining thegit
command and its parameters, it's installed. -
Check if PHP is installed on your machine by running
php -v
in a Terminal window. If not, install it via homebrew. -
Install MAMP and run it. You don't need MAMP Pro.
-
Create a GitHub account (if you don't have one already), and log into it in GitHub Desktop.
-
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".
- using the command line: running
-
Configure PHPStorm to recognize your PHP installation.
- Open PHPStorm.
- Open Preferences by clicking on "PHPStorm" in the top left of your screen or using Command+,.
- 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
/usr/bin/php
. 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. - Hit "Apply" to save your changes, then "OK" to close that window. Hit "OK" again to close the Preferences window.
-
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..."
- 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.
-
To configure database access, there are two main steps:
-
In your browser:
- 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 "MAMP" 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" field to "root" and leave the password blank (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 MAMP 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, click "@localhost" and then click the "+" button again. 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 "Databse" tab should now populate with all of the tables from the live site under "reck_club".
-
-
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:3000) in a browser window. Verify that you can see the public website.
-
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.
- 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.
- If you can not see points data or get a PHP error message: