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 fordisplay_errors
. You will see a few results. Look for the one around line 472. Set it todisplay_errors = On
. You will need to restart MAMP servers for this to come into effect.
- Mac:
- 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
- PHP
date()
function: http://php.net/manual/en/function.date.php - PHP
$_SERVER
: http://php.net/manual/en/reserved.variables.server.php