Preparing Your Playground
This book contains many exercises, and all of them assume that you’ve prepared your environment as
explained in the next few pages. If you’re a PHP and MySQL veteran, here’s the quick list of software
requirements. If you have these, you can skip to the end of the chapter, where you’re instructed to create
a MySQL database for the few exercises in this book that use it.
Apache 2 or newer, with the mod_rewrite module
PHP 4.1 or newer
Your PHP installation should have these modules:
php_mysql (necessary for the chapters that work with MySQL)
php_gd2 (necessary for exercises in Chapter 5 and Chapter 10)
php_curl (necessary for exercises in Chapter 11)
If you already have PHP but you aren’t sure which modules you have installed, view your
configuration file. On a default Windows installation, this file is located in the
folder; if you
install PHP through XAMPP as shown in the exercise that follows, the path is
. To enable a module, remove the leading “
” from the
and restart Apache.
After installing the necessary software, you’ll create a virtual host named
will point to a folder on your machine, which will be your working folder for this book. All exercises you
build in this book will be accessible on your machine through
Lastly, you’ll prepare a MySQL database named
, which will be required for a few of the exer-
cises in this book. Creating the database isn’t a priority for now, so you can leave this task for when
you’ll actually need it for an exercise.
The next few pages cover the exact installation procedure assuming that you’re run-
ning Microsoft Windows. If you’re running Linux or using a web hosting account, we
assume you already have Apache, PHP, and MySQL installed with necessary modules.
The programming exercises in this book assume prior experience with PHP and
MySQL. However, if you follow the exercises with discipline, exactly as described,
everything should work as planned.
Chapter 1: You: Programmer and Search Engine Marketer
c01.qxd:c01 10:38 6
Bitcoin Dice - Crypto Casino