Skip to main content
Noble Desktop Publishing Team/2 min read

Setting Up

PHP/MySQL Class Files Setup

1

Copy phpclass Folder

From Desktop → Class Files. Cmd-C / Ctrl-C.

2

Paste into htdocs

Mac: Hard Drive → Applications → MAMP → htdocs. Windows: My Computer → C: → xampp → htdocs.

3

Enable Error Display in MAMP PRO

MAMP PRO hides PHP errors by default — turn on display for local dev.

4

Verify in Browser

Visit localhost:8888/phpclass (Mac) or localhost/phpclass (Windows).

Build Back-End Skills at Noble Desktop

Noble Desktop's Full-Stack Web Development Certificate teaches modern back-end development — concepts that carry across PHP, Node.js, and Python.

Learn how to properly set up your class files and configure MAMP PRO to display errors in this comprehensive PHP & MySQL tutorial.

Complete the following setup prior to beginning any exercises.

Topics Covered in This PHP & MySQL Tutorial:

Setting up Your Class Files, Setting MAMP PRO to Display Errors

Copying the Class Files into the Web Server Folder

Throughout this workbook you will be editing class files that we have prepared for you. In order for these PHP files to run, they need to be located in the web server folder that you installed during setup.

  1. If you haven’t already, download the class files for this book. Refer to the Downloading the Class Files chapter for instructions on how to download them.
  2. Go to Desktop > Class Files.
  3. Click once on the phpclass folder to select it.
  4. Hit Cmd–C (Mac) or CTRL–C (Windows) to copy it.
  5. Follow the appropriate Mac or Windows instructions below:

    • Mac: Go into Hard Drive > Applications > MAMP > htdocs
    • Windows: Go into My Computer > C: > xampp > htdocs
  6. Press Cmd–V (Mac) or CTRL–V (Windows) to paste the class files.

    Now the class files are in the root directory of our active web server.

MAMP PRO: Displaying Errors

By default MAMP PRO does not display PHP errors on the page; instead it just shows a blank document. This is a good secure practice for a production site, but for local development it makes it very hard to troubleshoot your code.

  1. Launch MAMP PRO.

  2. Click the PHP tab.

  3. At the bottom, next to Log errors, check to screen.

  4. Click Save.

  5. If it asks to restart the server, click Yes.