I have bought many O'Reilly books in my time and generally find them to be good to excellent in quality. This is the first O'Reilly book which I would not recommend to a friend. The previous reviews have already pointed out the problems. As an example, I found this WWW site in the introduction (page xii) which indicated that there would be "listed errata, examples, ..." The errata are here, but where are the examples which would save one typing? So instead of reading about examples, I will write a review and possibly help some other Mac OS users who bought the book.
As one reviewer has already remarked, the Mac OS user is poorly served by the meager instructions in the "tip" on page 23 about getting PHP to load in the Apache configuration file. I never did manage to find the httpd.conf file, not at least until I went to a PHP5 web site (http://www.entropy.ch/software/macosx/php/) which told me all I needed to know about installing the newer PHP5 and pointed out where the httpd.conf file is located (/etc/httpd/httpd.conf) for Apache in the Mac system. Turns out that this PHP5 installation, replacing PHP4, automatically sets up Apache for accepting php files, and it was better not to have modified that httpd.conf anyway.
No point in recounting the errors, but I would advise users of the book to print out the error pages, to avoid unneeded head-scratching. My own favorite error is the Figure 3-3 on page 39 which attempts to illustrate the scoping idea (I already knew this concept as a C++ progammer) . The variable $age=30 is assigned, and then a "Birthday() function is schematically indicated with an $Age=1 assignment. Lastly there is an echo $Age command. Just two pages previously the text points out that variables in PHP (as in C/C++/Perl, but not Fortran for those who remember) are case sensitive. So these are two different variables, and scoping would not matter. The top pointing arrow in the figure ("Value of $age comes from here") is somewhat poorly aligned, but seems to refer to the $age variable, while the bottom arrow refers to the $Age variable. So the figure really doesn't make the point about scoping (two different variables) and has an error in the $echo of an undefined variable.
Clearly O'Reilly's proof readers and editors were asleep when checking his book. If there is ever a second, improved edition, I would like a free copy.
|