Foundation PHP with Dreamweaver 8: Updates Since Publication
Any misprints or factual errors are listed on the book's official corrections page on the friends of ED site. This page is intended to keep you up to date with any new developments since the book's original publication.
Installing Apache and PHP on Windows Vista
Before installing Apache and PHP on Windows Vista, turn off User Access Control (UAC). You can turn UAC on again after installation. If you attempt to install them with UAC enabled, Vista locates vital files in the wrong place.
To disable UAC, log into Vista as an administrator, and open Control Panel. Select Classic View, double-click the User Accounts icon, and then click "Turn User Account Control on or off". Deselect the Use User Account Control (UAC) checkbox, and click OK. Click Restart Now when prompted by Vista.
To turn UAC back on, follow the same procedure, but select the Use User Account Control (UAC) checkbox.
Windows installer now offers full features
The release of PHP 5.2.0 is accompanied by a dramatically improved Windows installer. If you would prefer to automate the installation of PHP, see the full instructions for using the new installer in the Tutorials section of this site.
Apache 2.2 series on Windows requires PHP 5.2.0 or above
The Apache 2.2 series requires
php5apache2_2.dll to support PHP on Windows. This file is included only in PHP 5.2.0 and higher. If you are using an earlier version of PHP, you must install Apache 2.0, as described in the book.
The installation and configuration instructions for Apache 2.2 are identical to those for Apache 2.0 with the following exceptions:
- The default installation location for Apache 2.2 is
C:\Program Files\Apache Software Foundation\Apache2.2
- The configuration file,
httpd.conf, is considerably shorter, so the line numbers are different from those shown in the book
- The command in step 3 on page 67 needs to point to
php5apache2_2.dll, instead of
php5apache2.dll, like this:
LoadModule php5_module c:/php5/php5apache2_2.dll
Creating virtual hosts with Apache 2.2
Apache 2.2 adopts a modular approach to its configuration files, so virtual host definitions are now normally contained in an external file, rather than being listed at the bottom of
http.conf. See the tutorials section of this site for details of how to create virtual hosts with Apache 2.2.
Enabling PHP on Mac OS X Leopard
When Mac OS X 10.5 was released (26 October 2007), the Mac PHP package created by Marc Liyanage that I recommended in the book was not compatible with Leopard. If a compatible version is still not available, follow the detailed instructions for setting up PHP in Leopard in the Tutorials section.
Dreamweaver 8.0.2 hotfix for PHP
If you are using Dreamweaver 8.0.2, get the PHP hotfix from Adobe, which solves important problems affecting the use of CONCAT() in Chapter 9 and the XSL Transformation server behavior in Chapter 12. More details here.
Universal binary of PHP 5 for Mac requires OS X 10.4
Marc Liyanage has now switched to building Universal binaries for PHP 5. They work on both PowerPC and Intel Mac processors, but require a minimum of OS X 10.4. Marc no longer provides support for earlier versions of OS X. If you're not willing or able to upgrade your operating system, alternative sources of help are MAMP and PHPmac. I don't have direct experience of either, but MAMP seems to be well liked by many Mac users.
phpMyAdmin installation procedure changed again!
As fate would have it, phpMyAdmin changed its installation procedure the day before Foundation PHP for Dreamweaver 8 left the printers. Since version 2.7.0, phpMyAdmin no longer contains an 845-line file called config.inc.php. All the main configuration has been moved elsewhere, and you have to create a much simpler version of config.inc.php (just a couple of lines) yourself.
The revised instructions were incorporated into the second printing, but they've changed yet again with version 2.8.0—the second change in the space of three months. Fortunately, the changes aren't major.
If youare the only user of the computer and don't need to password-protect access to phpMyAdmin, this is what the file should contain:
$i = 1;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['password'] = 'mysqlRootPassword';
(Use your real root password in place of mysqlRootPassword.)
If you want to protect access to phpMyAdmin by prompting for a password, config.inc.php should look like this:
$i = 1;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
Changes to phpMyAdmin 3.0
The user interface for defining new tables in phpMyAdmin has changed in phpMyAdmin 3, which was released in late September 2008. See my blog entry for a list of the differences.
Loading SQL from a file—phpMyAdmin change
Since version 2.7.0, phpMyAdmin has a separate tab for importing SQL from a file. Instead of clicking the SQL tab, click Import. This affects the instructions on pages 258, 417, and 474. The rest of the procedure is identical.
8.0.2 changes Advanced Recordset dialog box
The Dreamweaver 8.0.2 updater changes the way you define temporary variables for SQL queries. The Add Parameter dialog box has been replaced by an Edit Variable dialog box, which contains one extra field: Type. This new field offers three self-explanatory options: Numeric (default), Text, and Date.
The new field serves a two-fold purpose: it checks that a numeric runtime value is actually a number, and it automatically encloses text and dates in quotes. This not only makes the construction of SQL queries easier, it increases security. Scripts will fail if anyone attempts to inject text where a number is expected. Consequently, you should always choose the correct setting for Type.
Because Dreamweaver 8.0.2 automatically inserts quotes around text variables, the code in step 7 on page 313 no longer needs quotes. It should now read:
WHERE authors.first_name = var1 and authors.family_name = var2
Change to code on page 359 (Dreamweaver 8.0.2)
The way Dreamweaver 8.0.2 handles variables in SQL queries means that the code in step 11 on page 359 needs to be amended like this:
WHERE username=%s AND user_id != %s",
InterAKT free trial no longer available
The acquisition by Adobe of InterAKT in September 2006 means that the 30-day free trial of MX Kollection 3 mentioned on page 365 is no longer available. After the acquisition, Adobe replaced MX Kollection 3 by Kollection, which was also withdrawn the following April upon the release of Dreamweaver CS3. Most of the functionality is now incorporated in Adobe Dreamweaver Developer Toolbox (ADDT), which is compatible only with Dreamweaver CS3.
Unless you own either MX Kollection 3 or Kollection, you will not be able to complete the final 10 pages of Chapter 10. However, the first half of the chapter builds exactly the same functionality using Dreamweaver's built-in server behaviors. The purpose of the final section was simply to demonstrate a different approach to the same problem.
The online gallery in Chapter 11 also uses an InterAKT extension called MX Looper. Fortunately, the same functionality is provided in the PHP Horizontal Looper, a free extension created by Tom Muck. You can find revised instructions for pages 420-1 in the tutorials section of this site.