Author: Julie C. Meloni
Audience: Developers wanting to learn how to use PHP, MySQL and Apache together
Reviewer: Kay Ewbank
This book has some pretty good parts, but other elements are poor. It’s actually constructed from parts of three earlier Sam’s books on the separate elements, with some extra chapters added in. The author says the assumption is that you understand how the Web works from an admin viewpoint, so the Apache chapters in particular need prior knowledge. I’d say the MySQL chapters also work best if you have a certain degree of knowledge, but you could get by without knowing very much about PHP.
The book comes with a CD containing Apache, MySQL and PHP, but you’re probably better off downloading the most recent versions from the separate websites. I certainly experienced problems installing the versions on the CD, and others have reported similar frustrations. On the whole, you probably need extra help alongside the instructions in the first four chapters on installing and configuring XAMPP, MySQL, Apache and PHP.
The next caveat, and it’s a big one, is that you shouldn’t trust the code. By all means read the descriptions, the concepts are on the whole explained well. The problem is that if you’re typing in the code, following along the examples, and you hit errors, it’s not necessarily your fault. While reading I found a number of errors in the code; on checking, I discovered they’d been there since earlier editions, and had been commented on by readers, but no-one had bothered to update the code in the newer editions, or even include the errors in the list on the Sams website.
Having published programming books myself, I know how easy it is for errors to creep in, but there seems little point in having a fifth edition if you’re still going to have the same errors that have been reported in the third edition and even earlier. Fortunately, the code samples on the CD are rather better, so my advice is if you hit a brick wall with the code, check the CD, then do a quick search online to see what the code should actually look like.
However, learning to program is as much about the concepts as it is about the ‘now type this’ type of instructions, so the rest of this review is written with that as the aim.
Assuming you’re starting reading at Chapter 5, i.e. skipping Part I on Getting Up and Running, at things get off to a good start. The explanations of PHP are good, starting from the absolute basics before moving on to flow of control, functions, arrays and objects. There are chapters on working with forms, cookies and user sessions, files and directories, and images.
Having worked swiftly through the basics of PHP, the book then moves on to PHP and MySQL integration. There’s a chapter on understanding the database design process, and you’re then introduced to some of the basic SQL commands. This is one part where you could hit problems if you’re a MySQL beginner. For example, you’re told that you create a table using CREATE TABLE xxx, and there’s a code snippet showing how to create a grocery inventory table. All perfectly fine, but not a lot of use if you haven’t already created and used a database. Presumably this was a bit that was cut out when taking the material from the original source book. If you can work your way around such drawbacks, the material is fine, and there are chapters on using transactions and stored procedures, and on interacting with MySQL using PHP.
The book then moves on to a number of chapters looking at a variety of ‘projects’ such as a mailing list, online address book, discussion forum, storefront, shopping cart and calendar, ending with a chapter on XML and JSON.
The final section of the book looks at administration and fine tuning, with chapters on tuning the performance of Apache, using virtual hosting, setting up a secure Web server, optimizing MySQL, performing software upgrades and using application frameworks.
In summary, this book has some good sections. The PHP tutorial chapters seem good, and the different projects would be useful if you’re trying to do that sort of thing yourself. Some of the drawbacks seem to stem from the fact it’s an amalgam of parts of other books, so some topics have been missed out. Secondly, the errors in the code snippets will cause confusion. Personally, I’d want to read other books teaching me PHP, MySQL and Apache before reading the project chapters in this one to get some ideas about how the three work together.