PHP is a widely used scripting language for web development. It allows websites to be dynamic by executing code on the server. Websites function by storing files on servers that are connected through the internet. When a link is opened, the requested file loads on the user's computer from the server. PHP code is executed on the server and the results are sent to the browser as HTML. It is free, open source, and allows developers to build both static and dynamic websites.
3. How do websites work?
• Just like the files that are stored in your computer, websites also basically files that are
stored in another computer called the server.
• Many servers are together connected through the internet.
• And this why, when you open a link, that particular file from that server gets loaded on
your computer and you see that particular website.
6. Frameworks !!
• A framework basically is like the Legos, with which you make a structure.
• They are like the building blocks created by someone else, and you use these to make
your own website, and use them as and how you want.
7. Web Server
• Web server is a computer where the web content is stored.
• Web site is collection of web pages while web server is a software that
respond to the request for web resources.
• Eg:
• The software performs a similar role to a restaurant host.
• When you arrive at a restaurant, the host greets you, checks your booking
information, and takes you to your table.
• Performs the role of the restaurant’s maître d’ by handling communications with the
website, handling your requests, and making sure that other modules are ready to
serve you.
• Also like the busboy clearing tables. It cleans the memory, cache and modules and
clears them for new website visitors.
• In a similar way, the webserver checks for the web page you have requested.
10. The five leading web servers in the market are:
• Apache HTTP Server
• Microsoft Internet Information Services
• Lighttpd
• Nginx Web Server
• Sun Java System Web Server
11. What is ?
• PHP stands for Hypertext Pre-Processor which is a recursive acronym.
• PHP is a scripting language used to develop static and dynamic
webpages and web applications.
Here are a few important things you must know about PHP:
• PHP is an Interpreted language, hence it doesn't need a compiler.
• To run and execute PHP code, we need a Web server on which PHP must be
installed.
• PHP is a server side scripting language, which means that PHP is executed on
the server and the result is sent to the browser in plain HTML.
• PHP is open source and free.
12.
13. History of PHP
• Created by Rasmus Lerdorf in 1994. Initially developed for HTTP usage
logging and server-side form generation in Unix.
• elePHPant – The Mascot.
• Personal Home Page
• Track the hits on the Websites.
• According to W3techz, 79.2% of web is still powered by PHP.
• 20 Million Websites
• 1 Million Web Servers
14. Why PHP?
• Slow website speed.
• Bad user experience.
• Poor security features.
15. HTTP
• A protocol used to access the data on the World Wide Web (www).
• The HTTP protocol can be used to transfer the data in the form of
plain text, hypertext, audio, video, and so on.
• HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files.
• HTTP is used to carry the data in the form of MIME-like format.
• The HTTP differs from the SMTP in the way the messages are sent
from the client to the server and from server to the client.
16.
17.
18.
19.
20. What is Apache Web Server?
• Apache HTTP Server is a free and open-source web server that
delivers web content through the internet.
• It was revealed that the name originated from the respect of the
Native American tribe for its resiliency and durability.
• Apache is just one component that is needed in a web application
stack to deliver web content.
• One of the most common web application stacks involves LAMP, or
Linux, Apache, MySQL, and PHP.
21. • Apache is considered open source software, which means the original
source code is freely available for viewing and collaboration.
• One of the pros of Apache is its ability to handle large amounts of
traffic with minimal configuration.
• Some of the most popular modules that can be added are SSL, Server
Side Programming Support (PHP), and Load Balancing configs to
handle large amounts of traffic.
• Apache can also be deployed on Linux, MacOS, and Windows.
Why Apache Web Server?
22. How does Apache Web Server Work?
• Apache functions as a way to communicate over networks from client
to server using the TCP/IP protocol.
• The Apache server is configured via configs files in which modules are
used to control its behavior.
• Apache listens to the IP addresses configured in its config files that
are being requested.
23. PHP Syntax Rules
• Adding php code inside the PHP tags is known as Escaping to php.
• <?php ... ?>
• Apart from the standard code can also use the Short-open tags:
• <? ... ?>
• HTML script tags, like we do for adding JavaScript code in HTML
document:
• <script language="PHP"> ... </script>
• Every expression in PHP ends with a semicolon ;
24. • Commenting on php
• Both single line and multi-line comments are supported in PHP.
• For single line comment, we can either use # or // before the comment line.
• And for multi-line comments, we use /* ... */.
• PHP is case sensitive, which means that a variable $tiger is not same as
$Tiger. Both of these, represent two different variables here.
• But all the predefined keywords and functions like if, else, echo etc. are case
insensitive.
<?php
echo "Hello, World!";
ECHO "Hello, World!";
?>
• PHP uses curly braces to define a code block.
26. Is PHP the right language?
• PHP is open source and free, hence you can freely download, install and start developing using it.
• PHP has a very simple and easy to understand syntax, hence the learning curve is smaller as compared
to other scripting languages like JSP, ASP etc.
• PHP is cross platform, hence you can easily develop and move/deploy your PHP code/project to almost
all the major operating systems like Windows, Linux, Mac OSX etc.
• All the popular web hosting services support PHP. Also the web hosting plans for PHP are generally
the amongst the cheapest plans because of its popularity.
• Popular Content Management Systems like Joomla, Drupal etc. are developed in PHP and if you want
to start your own website, you can easily do that with PHP.
• With PHP, you can create static and dynamic webpages, perform file handling operations, send emails,
access and modify browser cookies, and almost everything else that you might want to implement in
your web project.
• PHP is fast as compared to other scripting languages like JSP and ASP.
• PHP has in-built support for MySQL, which is one of the most widely used Database management
system.
27. Uses of PHP
To further fortify your trust in PHP, here are a few applications of this
amazing scripting language:
• It can be used to create Web applications like Social Networks(Facebook, Digg),
Blogs(WordPress, Joomla), e-commerce websites(Open Cart, Magnetos etc.) etc.
• Command Line Scripting. You can write PHP scripts to perform different operations on
any machine, all you need is a PHP parser for this.
• Sending Emails or building email applications because PHP provides with a robust email
sending function.
• WordPress is one of the most used blogging(CMS) platform in the World, and if you know
PHP, you can try a hand in WordPress plugin development.
Editor's Notes
Who is the Client here? The one who access
Who is the browser here? The Client.
What is HTTP Server?
URL Defines 4 Parts
HTTP Is an application layer protocol that is used to virtually transmit files and other data.