Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (932.93 KB, 7 trang )
<span class='text_page_counter'>(1)</span><div class='page_container' data-page=1></div>
<span class='text_page_counter'>(2)</span><div class='page_container' data-page=2></div>
<span class='text_page_counter'>(3)</span><div class='page_container' data-page=3>
by Robin Nixon
Copyright © 2009 Robin Nixon. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (<i></i>). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or <i></i>.
<b>Editor:</b> Andy Oram
<b>Production Editor:</b> Sumita Mukherji
<b>Copyeditor:</b> Nancy Kotary
<b>Proofreader:</b> Kiel Van Horn
<b>Indexer:</b> Ellen Troutman Zaig
<b>Cover Designer:</b> Karen Montgomery
<b>Interior Designer:</b> David Futato
<b>Illustrator:</b> Robert Romano
<b>Printing History:</b>
July 2009: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. <i>Learning PHP, MySQL, and JavaScript</i>, the image of sugar gliders, and related trade
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information
con-tained herein.
<b>TM</b>
This book uses RepKover™, a durable and flexible lay-flat binding.
ISBN: 978-0-596-15713-5
HTTP and HTML: Berners-Lee’s Basics 2
The Request/Response Procedure 2
The Benefits of PHP, MySQL, and JavaScript 5
Using PHP 5
Using MySQL 6
Using JavaScript 7
The Apache Web Server 8
About Open Source 9
Bringing It All Together 9
Test Your Knowledge: Questions 11
What Is a WAMP, MAMP, or LAMP? 13
Installing a WAMP on Windows 14
Overcoming Installation Problems 14
Testing the Installation 16
Alternative WAMPs 18
Installing a MAMP on Mac OS X 19
Some Final Tweaking 24
Other Alternatives 25
Installing a LAMP on Linux 25
Working Remotely 26
Logging In 27
Using FTP 27
Using a Program Editor 28
Using an IDE 30
Test Your Knowledge: Questions 32
<b>Robin Nixon</b> has worked with and written about computers since the early 1980s (his
first computer was a Tandy TRS 80 Model 1 with a massive 4 KB of RAM!). During
this time he has written in excess of 500 articles for many of the UK’s top computer
magazines. <i>Learning PHP, MySQL, and JavaScript</i> is his third book.
Robin started his computing career in the Cheshire homes for disabled people, where
he was responsible for setting up computer rooms in a number of residential homes,
and for evaluating and tailoring hardware and software so that disabled people could
use the new technology—sometimes by means of only a single switch operated by
mouth or finger.
After writing articles for computer magazines about his work with disabled people, he
eventually worked full time for one of the country’s main IT magazine publishers, where
he held several roles including editorial, promotions, and cover disc editing.
With the dawn of the Internet in the 1990s, Robin branched out into developing
web-sites. One of these presented the world’s first radio station licensed by the music
copy-right holders, and was featured in several news reports on TV and radio networks in
the United Kingdom. In order to enable people to continue to surf while listening, Robin
also developed the first known pop-up windows.
Robin lives on the southeast coast of England with his wife Julie, a trained nurse, and
The animals on the cover of <i>Learning PHP, MySQL, and JavaScript</i> are sugar gliders
(<i>Petaurus breviceps</i>). Sugar gliders are small, gray-furred creatures that grow to an adult
length of six to seven-and-a-half inches. Their tails, which are distinguished by a black
tip, are usually as long as their bodies. Membranes extend between their wrists and
ankles and provide an aerodynamic surface that helps them glide between trees.
Sugar gliders are native to Australia and Tasmania. They prefer to live in the hollow
parts of eucalyptus and other types of large trees with several other adult sugar gliders
and their own children.
Sugar gliders make popular pets because of their inquisitive, playful natures, and
be-cause many think they are cute. But there are disadvantages to keeping sugar gliders as
pets: as they are exotic animals, sugar gliders need specialized, complicated diets
con-sisting of items such as crickets, a variety of fruits and vegetables, and mealworms;
healthy housing requires a cage or space no less than the size of an aviary; their
dis-tinctive scents can be bothersome to humans; as they are nocturnal creatures, they will
bark, hiss, run, and glide all night long; it’s not uncommon for them to extricate their
bowels while playing or eating; and in some states and countries, it is illegal to own
sugar gliders as household pets.