Published in 2018 by Cavendish Square Publishing, LLC 243 5th Avenue, Suite 136, New York, NY 10016
Copyright 2018 by Cavendish Square Publishing, LLC First Edition
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any meanselectronic, mechanical, photocopying, recording, or otherwisewithout the prior permission of the copyright owner. Request for permission should be addressed to Permissions, Cavendish Square Publishing, 243 5th Avenue, Suite 136, New York, NY 10016. Tel (877) 980-4450; fax (877) 980-4454.
Website: cavendishsq.com
This publication represents the opinions and views of the author based on his or her personal experience, knowledge, and research. The information in this book serves as a general guide only. The author and publisher have used their best efforts in preparing this book and disclaim liability rising directly or indirectly from the use and application of this book.
All websites were available and accurate when this book was sent to press.
Library of Congress Cataloging-in-Publication Data
Names: Murphy, Grace.
Title: The power of PHP / Grace Murphy.
Description: New York : Cavendish Square Publishing, 2018. | Series: The power of coding | Includes bibliographical references and index.
Identifiers: ISBN 9781502629463 (library bound) | ISBN 9781502634191 (pbk.) | ISBN 9781502629470 (ebook) Subjects: LCSH: Computer programming--Juvenile literature. | PHP (Computer program language).
Classification: LCC QA76.73.P224 M87 2018 | DDC 006.7--dc23
Editorial Director: David McNamara Editor: Caitlyn Miller Copy Editor: Rebecca Rohan Associate Art Director: Amy Greenan Designer: Joe Parenteau Production Coordinator: Karol Szymczuk Photo Research: J8 Media
The photographs in this book are used by permission and through the courtesy of: Front cover, Hero Images/ Alamy Stock Photos; p. 4 Vincent Pontier/ . flickr.com/photos/wilgengebroed/)/File: Internet of things signed by the author.jpg/Wikimedia Commons.
Printed in the United States of America
Opposite : PHP's mascot is the ElePHPant.
The History of PHP
E very time you log on to Facebook, check Wikipedia for information you are curious about, or connect to a WordPress-created web page, applications written using PHP make it possible. PHP is what is known as a server-side scripting language , meaning its written to automate certain tasks and run on the server rather than on the users own computer. This immensely popular programming language helps accomplish tasks as varied as creating secure logins, accessing a multitude of databases, and incorporating Flash videos in dynamic web pages (web pages featuring content that changes based on user interaction). Some estimates indicate that PHP supports one-third of the web. Despite the complex web pages it is used to create, PHP is easy for novice programmers to learn. It also has many advanced features for more experienced programmers. But beyond PHPs huge potential for programmers of all skill levels, it also has a fascinating history.
The Origins of PHP
As Rasmus Lerdorf, the originator of PHP tells it, he was not interested in creating a programming language, he just wanted to solve a problem. The Danish-Canadian systems engineer was looking for an easy way to develop and maintain his personal web page. So in 1994, he began working on the original PHP component, which was a common gateway interface (CGI). Lerdorf used the general-purpose programming language C to establish the components that would help him maintain his personal home page. Thus, he called his creation PHP Tools after personal home page and released it to the public. This first version, also called PHP 1, can still be downloaded at www.museum.php.net.
Rasmus Lerdorf created PHP.
Lerdorf had decided to make his software open-source . This meant that his solution would be freely and publicly accessible. It could also be shared and modified. According to Lerdorf, people participate in open-source software development for several reasons, including selfinterest (Lerdorfs self-identified motivation), because they have a problem they want solved; self-expression, because it satisfies their creative impulse; and altruism, because they want to improve the world.
The open-source movement had begun in the United States in the 1950s with academics sharing software among their colleagues. Soon, though, computer hardware manufacturers began charging for the software that was used on their machines. By the 1980s, some technology leaders were dissatisfied with the steadily rising software costs. They formed the GNU project to develop a software operating system that developers and users would be free to use, distribute, modify, and improve. The Linux operating system, with millions of users today, was the first result of that project.
Although the term open-source was not coined until 1998, by the mid-1990s, when Lerdorf began developing his web scripting tools, the movement was gaining traction with the growth of dotcom companies. In particular, the Apache HTTP server, which played a critical role in the development of the World Wide Web and is today the most used web software in the world, was released as open-source software.
Rasmus Lerdorf
o o o
"As strange as it may sound, I don't actually like programming. My passion is for developing systems that simplify complicated problems. "Rasmus Lerdorf
Rasmus Lerdorf, original creator of PHP, was born on Disko Island, off the coast of Greenland in Baffin Bay, on November 22, 1968. His early years were spent in Denmark. In 1980, he moved with his family to Canada. They settled in King City, Ontario, in 1983. Lerdorf attended King City Secondary School, where he played soccer and basketball.
He began developing his computer skills as a teenager by writing software for the Unisys ICON, a system built specifically for Ontario's schools. These computers, according to Lerdorf, didn't have much software and "nobody knew anything about them. " With his friend Ben Eng, Lerdorf created software for this distinctive machine and ended up teaching an adult education computer course. He also taught an accreditation program for teachers. Lerdorf credits these early experiences with providing both a stimulus and a solid base for his later interests.
Lerdorf enrolled at the University of Waterloo, whose Cheriton School of Computer Science produced roughly one-third of Canada's computer science graduates in the 1980s. At that time, any student who could demonstrate the ability to crash the computer system was treated to a drink for uncovering a weakness. Lerdorf was part of the computer co-op program and worked in several Canadian locations. In his final assignment, he worked with Nutec, a software company in Brazil. With his experiences in a variety of countries, Lerdorf became fluent in five spoken languages, as well as multiple computer languages. He graduated in 1993 with a Bachelor of Applied Science in Systems Design Engineering.