Domain: osborne.com
Stories and comments across the archive that link to osborne.com.
Stories · 3
-
How to Do Everything with PHP and MySQL
Michael J. Ross writes "When it comes to creating a dynamic Web site with data store capabilities, the site developer can choose from many technologies, including PHP and MySQL. The combination of the two is rapidly emerging as a favorite, partly because they work well together, and partly because they are both available under open-source licenses. As a result, technical book publishers are cranking out a growing number of high-priced tomes that try to cover all of the details of either technology, or both. But for the developer just getting started in either one, there is a new title that could prove more accessible: Vikram Vaswani's How to Do Everything with PHP and MySQL, published by McGraw-Hill/Osborne." Read on for the rest of Ross's review. How to Do Everything with PHP and MySQL author Vikram Vaswani pages 381 publisher McGraw-Hill/Osborne rating 7 reviewer Michael J. Ross ISBN 0072257954 summary A tutorial on PHP and MySQL, geared to the new developer.The publisher has a page on their Web site devoted to the book; for some reason, it lists the book as containing 400 pages, but my copy has 381. The page also has links to a table of contents and a sample chapter, namely the first one. For those readers with very slow Internet access or unstable Adobe Acrobat plug-ins installed, be aware that the sample chapter -- and even the table of contents -- are offered only as PDFs, but the two links give no warning.
Most technical publishers, for every one of their books, wisely have links to the errata and sample code, right there on each book's Web page. This is the best approach, because when readers are having difficulty getting a book's examples to work correctly, they want to be able to quickly find and download the most up-to-date sample code, as well as check the errata page for any bugs in the printed code. Unfortunately, McGraw-Hill/Osborne has their links to those two types of information in an easily-overlooked part of a menubar, using small black text on a blue background. The links are near the upper left-hand corner, and outside the content section of the Web page, where the typical reader would be seeking fruitlessly for them.
The companion Web site for the book is hosted by Vaswani's software consulting firm, Melonfire. The site has the book's table of contents (in HTML), a link to chapter 1 in PDF, a profile of the author, three full-length case studies, a feedback form, and an extensive collection of links to PHP and MySQL reference material, discussion lists, articles, and tutorials. At the end of the Introduction in the book, the author invites the reader to use that companion site for connecting with other PHP users, and sharing their thoughts on PHP and MySQL development. The site itself has no such forum, so the author probably meant the discussion lists.
The companion site also has a link to download a Zip file containing all of the sample applications from the book -- from chapters 7, 12, and 16 -- comprising nine PHP scripts, an SQL file, and a data file. The code snippets themselves do not appear to be included in the download. This shouldn't pose a difficulty for the typical reader, since few of the code snippets are long. Besides, typing them in on one's computer can help to reinforce the language syntax that one is learning, as well as decent code formatting (valuable for newbies).
The book is organized into four parts.The first of these presents the basics of PHP and MySQL, including the history and features of both technologies, as well as how to install them on Unix and Windows systems, verify the integrity of the installations, and make some critical security and configuration changes, such as changing passwords. Parts II and III cover the basics of PHP and MySQL, respectively. The fourth and final part describes how to use the two together. To that end, every chapter contains snippets of code to illustrate the ideas being described. In addition, each section is wrapped up and illustrated with a sample application. For PHP, the author shows how to build a session-based shopping cart. For MySQL, he presents a simple order-tracking system. For using PHP and MySQL together, he shows a news-publishing system.
Despite its title, the book clearly does not tell the reader how to do everything with PHP and MySQL. As the author notes in the Introduction, the book is not designed to be a complete reference for either technology, but instead intended as a tutorial for Web developers who are interested in learning how to do server-side scripting in combination with a database management system. Vaswani states that he does not assume prior knowledge of programming or database fundamentals, and that these basic concepts will be taught by example, using tutorials and realistic examples. I suspect a reader not familiar with HTML, however, could be easily baffled by the book. On the other hand, most if not all developers reading a book on PHP or MySQL are likely to already know HTML well enough to understand the output of PHP-enhanced Web pages.
One strength that this book has over many similar ones is that the author explains up front how to install PHP and MySQL, rather than relegating these topics to an appendix, or skipping them entirely. This is critical, because many programmers will find that the most challenging aspects of getting started with PHP and MySQL, are simply getting them installed and working, along with a Web server, such as Apache -- and not coding the applications themselves.
Another welcome aspect of the book is the author's enthusiasm for the technologies -- although characterizing MySQL as "quite friendly" (page 150) is a stretch. Furthermore, his explanations are clear and concise. In addition, Vaswani makes no pretense that his book has all the answers; he frequently refers the reader to URLs in the online manuals of the products, for more details. In addition, he does a nice job of illustrating the advantages of normalized database tables, and later explaining how to format query output -- an important topic omitted in many similar books.
Yet, like all books, this one is not perfect. There are a number of errors or pitfalls in the book that could confuse the reader. They range from incomplete explanations of what a user will see when running particular commands, to the sort of errata one finds in all technical books. I found over two dozen in total (there may be more). In the interests of keeping this Slashdot version of the book review close to the recommended length, I won't list all of the problems here, but will instead refer the reader to a longer version of this book review, if they are interested in those details.
Aside from its many minor flaws, I recommend this title to any programmer who wants to learn the basics of PHP and MySQL. Even though the publisher could improve their production quality, choice of binding, and Web page, the author has done a good job of clearly presenting the major points. Future editions could incorporate fixes to the errors noted in the longer version of this review, as well as better explain to the neophyte how to test/debug the code snippets. Nonetheless, the intended reader would be well served by this particular book.
Michael J. Ross is a freelance writer, computer consultant, and the editor of PristinePlanet.com's free newsletter. You can purchase How to Do Everything with PHP and MySQL from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page. -
Administering Apache
Sure, you know that Netcraft tests have for a while provided empirical evidence of Apache's usefulness and ubiquity. But if you're called upon to use Apache in your workplace (or if you care to serve pages for fun off your home box), you might need more to go on. Chromatic took some busy time out of his life to write this review of Administering Apache, which he says takes a "calculated, strategic approach" to what has become one of the world's most important pieces of software. Administering Apache author Mark Arnold, Jeff Almeida, & Clint Miller pages 513 publisher McGraw Hill rating 8 reviewer chromatic ISBN 0-07-212291-9 summary This task-oriented guide presents a comprehensive overview of Apache's features, suitable for the small homepage provider and the huge virtual-domain farm.
The Scoop It's hard to know where to begin using something as powerful and flexible as Apache. Serving basic pages is easy, but how do you keep track of visitors? How do you provide unique and appropriate content? What happens when you need more than just a static server?Adminstering Apache takes a calculated, strategic approach. Dedicating the first chapter to the needs of various entities (corporation, small business, large ISP, small ISP), it discusses the Apache features that will come into play. While the book can be read from start to finish as a tutorial, following one of the roadmaps is the quickest way to get things up and running.
What's to Like? People who love details will appreciate many sections, like the comprehensive configuration information. The book passes the usefulness test, having served as an authoritative reference on multiple occasions. For example, the installing/compiling chapter has an excellent list of modules and configuration suggestions that came in handy with a recent project. (The index alone fills 19 full pages of two-column, small print text.)Instead of grouping all of the possible httpd.conf directives in one section, the authors cover them by topic. Localisation information can be found in the content chapter, while logging directives live in chapter 5. This division of information fits the topical philosophy, increasing the work's reference value.
While by no means essential data or a comprehensive reference, the chapter on creating new Apache modules was very interesting. The authors write a sample module in C to implement a new MIME type handler. The program's evolution and refinement demonstrates Apache's design and API, as well as good module programming practices.
The scope of the book covers more than just Apache. Aside from obvious topics of security and networking issues, the text includes firewall and proxy information, pages of related Internet sites, and even sample bash scripts to create new homepage users and directories for ISPs. Other sections discuss HTTP and CGI from protocol and implementation standpoints. (Besides, any other book dedicated to Apache business use that doesn't have a section on paid referrer logs is incomplete.)
What's to Consider? As with Apache itself, there is a strong Unix flavor to the text. The single Windows NT chapter is only five pages long, focusing on a few important differences from the Unix version. The other chapters are reasonably cross-platform (though most of the CGI examples are shell scripts, not Perl or PHP).While a definitive guide would easily double the size of the book, precious little space covers common modules. Besides brief descriptions of distributed modules, the only real discussion involves mod_ssl, though a few have links provided. Also, the book concentrates on Apache in a commercial environment. Perhaps the corporate intranet server best approximates the single-user, small-site setup common for developers' personal pages.
From a writing standpoint, some sections are best left as references. The authors deserve sympathy for writing two pages describing log format string substitutions -- let alone testing and editing them. Though filled, in places, with almost too much information, the writing never becomes muddied. Still, you won't stay awake nights reading some chapters.
The Summary While not the most exciting book to grace your shelf, Administering Apache is a detailed and useful guide to the Apache web server. More than an introduction, it will be a good reference, not just for the mechanics of the software, but for the technique and mindset necessary to maintain an installation in a business environment. Table of Contents- Planning Ahead
- Creating the Web Server
- Creating the Web Site
- Manipulating Content
- Using Logs
- Securing the Server, the Content, and the Connection
- Creating Homepage Web Sites
- Creating Virtual Domain Web Sites
- Proxying with Apache
- Troubleshooting
- Using Apache on Windows NT
- Programming the Apache Server
You can purchase this book at Fatbrain. -
Linux Beginners Series' Final Installment
Now chromatic has stepped through another couple of books, in addition to the nine in the previous parts of this series on books for the Linux newbie-to-semi-newbie. Actually, the selections this time go on the assumption that you've taken a few weeks (or some very intense days) to absorb the information you need to accomplish some basic tasks, and they take on the challenge of going beyond the basics. Note: here are links to part one, part two, and part three of this series. (See below) author (Various) pages - publisher (Various) rating (vary) reviewer chromatic ISBN (varies) summary Books to take you beyond newbiehood comfortably.As this series comes to a close, we move up a notch on the complexity scale to install Linux as a network client. Where some previous books have discussed how to make your new OS play nicely with others, here are two dedicated to helping you replace an existing box or setup a new server from scratch.
The eleven books we've featured barely scratch the surface of the printed documentation available for new Linux users. For example, O'Reilly has two particularly good choices, Learning Debian GNU/Linux, available through their Open Books Project, and Running Linux, reviewed last year.
We've obviously overlooked other worthy titles. For the sake of completeness, what else may come in handy? Which books have you found most useful?
title Linux Administration: A Beginner's Guide publisher Osborne Included Stuff RedHat 6.1 CD-ROM (Publishers Edition) Intended Audience NT Administrators new to Linux. Scope Installation, introduction to Linux, networking setup, Internet and intranet applications. Technical Correctness Good. Writing style Easy to read and informative. OtherThough this book comes with a RedHat CD, nearly everything can apply to other distributions.
Here's a book aimed squarely at the ranks of NT administrators. Not only does it point out (fairly) the differences between NT and Linux, but it explains the Linux method in relation to the NT method. (For example, compare NT file sharing via Network Neighborhood and SMB to NFS shares.) From a practical standpoint, professional experience is almost necessary to understand the initial concepts -- but it's certainly understandable without too much prior knowledge.
Shah starts with some background, then steps lightly through a RedHat 6.1 Server installation. X, KDE, and GNOME get basic treatment, mostly related to configuration. Software installation comes next, in both RPM and tarball (.tar.gz file) formats.
Section two covers basic administration. Users come first, with command line and Linuxconf tools presented. A good chapter introduces the shell and basic commands for file manipulation, processes, and permissions. Next up is the boot process, detailing LILO and the rc scripts. Basic file system theory, tools, partitioning schemes, mounting, and quotas get their due. The core system services chapter covers important daemons like the parent process, the Internet super daemon, system logging, and the cron scheduler. Shah rounds out this section by discussing kernel building, patching, and installing, and includes a good chapter on individual system security. (While brief, it's good and useful, including plenty of links to sites with much more information).
Internet Services looks at DNS, ftp, web, SMTP, POP, and SSH services. While there's theory given, it's accompanied by practical examples of setting up the appropriate software. BIND (for DNS) and wu-ftpd (for FTP) get excellent treatment, while the sendmail section is pared down (compared to Shah's chapter in the previously reviewed Red Hat Linux 6 Unleashed) and the Apache chapter is slim. That's not a problem with sendmail, as there's plenty of information provided to use the m4 macros, but a serious Apache configuration would require additional research. The section ends with a chapter on QPopper (providing POP3 access to users) and another discussing security and cryptography as related to SSH. Versions one and two of the protocol are covered, with information on running both.
Part four details intranet services. Here's how to make your Linux server speak eloquently on a larger network. NFS server and client setup takes up one chapter, and NIS server and client setup the next. The author sagely includes suggestions for different network configurations. Samba has a similar treatment, though the configuration section concentrates mostly on the SWAT web-configuration tool. A short chapter on printing includes accessing remote printers via SMB shares, while a quick DHCP chapter packs in a lot of information. Rounding things out is a quick look at backups, concentrating on command line tools like dump and tar.
The final section, entitled "Advanced Linux Networking", covers NIC configuration and routing, as well as TCP/IP theory. It's short, but effective. Somewhat longer is the chapter on packet filtering, ipchains, and IP Masquerading. There's plenty of information to build an effective firewall, and pointers to additional resources won't leave you hanging. Shah concludes with an interesting tour of the /proc virtual file system. Two appendixes discuss, very briefly, popular Linux programming languages and popular programs for certain tasks -- mostly desktop software.
This book is likable and readable, while providing good information. While the treatment of some subjects is short, the author always provides references to more information. Administrators familiar with NT who are willing to see what the Linux fuss is all about will have no difficulty learning from this book.
title Linux Network Administrators Guide publisher O'Reilly & Associates Included Stuff Complete text online. Intended Audience New and moderately experienced administrators already somewhat familiar with Linux. Scope Network setup and configuration, some programs. Technical Correctness Complete. Writing style Readable, while aimed at the technically proficient. Other Wide scope of network types discussed.The Linux Documentation Project has produced some excellent work. This book is no exception. O'Reilly has updated the dead tree version with a new edition while providing the complete text at the link above.
Topics included cover what you'd expect, along with some features you might not have considered. Early on, the authors put forth an example network connecting a small brewery to an affiliated small pub. Subsequent chapters build on this simple Ethernet setup serving as a commented example.
This book is strong on theory, while not skimping on actual usage information. Detailed data about IP routing and address resolution, for example, contributes to understanding the tools, though the knowledge isn't a requirement to setting up BIND or gated. As you might expect, what's covered is covered comprehensively -- protocols like TCP, UDP, ICMP, and UUCP, dedicated Ethernet hardware, parallel port networking, and serial port-driven communications.
The first few chapters cover theory and configuration. There's plenty of information to get a single Linux box on an existing network, but read on! DNS server and client setup comes next. SLIP and PPP get their own chapters, of course. The firewalling chapter explains both ipfwadm (from the 2.0 series of kernels) and ipchains (2.2 series), clearly explaining the slightly different approaches to reach the same goal, in a long and excellent discussion. IP Accounting comes next, with IP Masquerading close behind. The discussions take a similar approach.
Network services take up the next few chapters. First up is the Internet daemon (inetd) and tcpwrappers. Next comes the NIS chapter, with good information about configuration and security. NFS follows suit. Rather unique to this book is a chapter on Novell's IPX protocol and the NCP filesystem, packing in some history, lots of theory, and information on managing bindery objects, printing to remote printers, and routing IPX packets. Following that is a discussion of Taylor UUCP, both as a client and a server.
E-mail and Netnews discussions end the book. Each gets a chapter describing the service from a basic standpoint, then a technical approach. Next, there are two or three chapters describing popular packages providing that service. For e-mail, these cover sendmail and exim (quite well). For news, it features C news, nntpd, and INN. As you'd expect, these chapters are quite detailed and easy enough to follow. Appendixes include copyright information, cable configurations, diagrams of the example network, and a quick blurb about SAGE (the System Adminstrators Guild).
While other books cover a wide range of topics in a scattershot fashion, the coverage here is highly focused. There's a good balance of history, theory, and applicability, making this book a very good starting point or a refresher for someone looking to fill in some gaps.
Taking space to explain the fundamentals of a topic instead of diving right into configuration files is very helpful. Knowing the theory of mail transport is more likely to help you configure any MTA than just knowing what's in sendmail.cf. Be aware that this isn't a one-stop shopping spot for every service you'll want to configure on your network. Instead, it's an overview of networking issues; narrow in scope, and detailed.
See the earlier Slashdot review by Christopher Thompson, for more on this book.
You can purchase Linux Administration: A Beginner's Guide or the Linux Network Administrator's Guide at Fatbrain.