Lecture 16: Intro to PHP

To-do for today’s class

  • Download starter file: lect16-intro-php/ (Dropbox)
  • Download MAMP (for both Mac and Windows): https://www.mamp.info/en/downloads/
      • Select PHP version 7.3.* by going to Preferences -> PHP
    • Turn on debug statements for PHP by going to php.ini, which can be found in:
      • Mac: /Applications/MAMP/bin/php/php{version_num}/conf/php.ini
      • Windows: C://MAMP/conf/php{version_num}/php.ini
      • In the php.ini file, search for display_errors. You will see a few results. Look for the one around line 472. Set it to display_errors = On. You will need to restart MAMP servers for this to come into effect.
    • Go back to MAMP and go to Preferences -> Web Server and change the Document Root folder to the folder that contains all your ITP 303 files (a parent folder is best).
  • Refer to the official PHP documentation here: http://php.net

Slides

Link to download PDF version.

Resources

Completed files