Datasheet

13
Chapter 1 Why PHP and MySQL?
Open source licensing
We’ve already dealt with the cost advantages of open source software in the “Cost” section of
this chapter. The other major consequence of these licenses is that the complete source code
for the software must be included in any distribution.
In fact, the Unix version of PHP is released only as source code; so far, the development team
has staunchly resisted countless pleas to distribute official binaries for any of the Unixes. At
first, new users (particularly those also new to Unix) tend to feel that source code is about as
useful as a third leg, and most vastly prefer a nice convenient
rpm. But there are both prag-
matic and idealistic reasons for including folders full of pesky
.c and .h files.
The most immediate pragmatic advantage is that you can compile your PHP installation with
only the stuff you really need for any given situation. This approach has performance and
security advantages. For instance, you can put in hooks to the database(s) of your choice.
You can recompile as often as you want: maybe when an Apache security release comes out,
or when you wish to support a new database application. By compiling a custom application
specifically suited to your system, or any given snapshot of your system, performance and
stability are increased over their already respectable baseline.
What sets open source software apart from its competitors is not just price but control.
Plenty of consumer software is now given away under various conditions. Careful scrutiny of
the relevant licenses, however, will generally reveal limits as to how the software can be used.
Maybe you can run it at home but not at the office. Perhaps you can load it on your laptop,
but you’re in violation if you use it for business purposes. Or, most commonly, you can use it
for anything you want but forget about looking at the code much less changing it. There are
even community licenses that force you to donate your improvements to the codebase but
charge you for use of the product at the end!
Don’t even think about coming back with a riposte that involves violating a software
license we’re covering our ears; we’re not listening! Especially with the explosion in no-cost
software, there’s just no good reason to break the law. Besides, it’s bad karma for software
developers. What goes around, comes around, don’t ya know?
For all their openness, the licenses for MySQL and PHP are quite different. You should not
assume that you understand the MySQL terms simply because you have read the PHP
license. They have many similarities to be sure but also some radically different provisions,
especially when it comes to when you should pay.
Table 1-3 shows examples of the various source and fee positions in today’s software
marketplace.
Table 1-3: Source/Fee Spectrum
Fee Structure Closed Source Controlled Source Open Source
Fee for all uses Macromedia ColdFusion
Fee for some uses Corel WordPerfect Sun Java MySQL
No fee for any use Microsoft IE Sun StarOffice GPLed software
Caution
03 557467 ch01.qxd 4/5/04 11:06 AM Page 13