SlideShare a Scribd company logo
1 of 14
Download to read offline
PHP Tech Talk
Presented By: Jignasha Vithalani
What is PHP
Overview:
• Server side scripting language
• Dynamic web page generation
• Open source (PHPLicense incompatible with GPL)
• Free
• Cross platform
• recursive acronym of Hypertext preprocessor which was previously Personal Home Page
whose syntax borrowed mostly from Perl
What PHP can do
PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can
do, such as collect form data, generate dynamic page content, or send and receive cookies. But
PHP can do much more
As HTML can be mixed with PHP scripts which will be executed on server side , It will be less
overhead to output HTML like in C or Perl
There are three main areas where PHP scripts are used
1) Server-side scripting
You need three things to make this work. The PHP parser (CGI or server module), a web server
and a web browser. You need to run the web server, with a connected PHP installation. You can
access the PHP program output with a web browser, viewing the PHP page through the server
What PHP can do
2) Command line scripting
You can make a PHP script to run it without any server or browser. You only need the PHP
parser to use it this way. This type of usage is ideal for scripts regularly executed using cron (on
*nix or Linux) or Task Scheduler (on Windows). These scripts can also be used for simple text
processing tasks
3) Writing desktop applications
PHP is probably not the very best language to create a desktop application with a graphical
user interface, but if you know PHP very well, and would like to use some advanced PHP features
in your client-side applications you can also use PHP-GTK to write such programs. You also have
the ability to write cross-platform applications this way
Flexibility of PHP
1)

2)

3)
4)

5)

PHP can be used on all major operating systems, including Linux, many Unix variants
(including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, and
probably others
PHP has also support for most of the web servers today. This includes Apache, IIS, lighttpd
and many others , And this includes any web server that can utilize the FastCGI PHP binary,
like lighttpd and nginx.
You have the choice of using procedural programming or object oriented programming
(OOP), or a mixture of them both
With PHP you are not limited to output HTML. PHP's abilities includes outputting images,
PDF files and even Flash movies (using libswf and Ming) generated on the fly. You can also
output easily any text, such as XHTML and any other XML file.
Most significant features in PHP is its support for a wide range of database. Writing a
database-enabled web page is incredibly simple using one of the database specific
extensions (e.g., for mysql), or using an abstraction layer like PDO, or connect to any
database supporting the Open Database Connection standard via the ODBC extension
Flexibility of PHP
1) PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP,
NNTP, POP3, HTTP, COM (on Windows) and countless others. You can also open raw network
sockets and interact using any other protocol. PHP has support for the WDDX complex data
exchange between virtually all Web programming languages. Talking about interconnection,
PHP has support for instantiation of Java objects and using them transparently as PHP
objects.
2) PHP has useful text processing features, which includes the Perl compatible regular
expressions (PCRE), and many extensions and tools to parse and access XML documents. PHP
standardizes all of the XML extensions on the solid base of libxml2, and extends the feature
set adding SimpleXML, XMLReader and XMLWriter support.
3) Availability of various extensions and modules for different features and reusable codes
4) As source code is available It can be modified according to program need and PHP can then
be recompiled for generating PHP binary
5) New Extension can easily be added which can either be dynamically linked or linked with
Zend engine
Popularity of PHP
 6 out of 10 most popular websites of world has used PHP
Website
Popularity(unique visitors)
Gooogle.com
1,000,000,000
Facebook.com
880,000,000
Youtube.com
800,000,000
Yahoo
590,000,000
Wikipedia.org
410,000,000
Wordpress.com
130,000,000
 PHP is used by 77.8% of all the websites whose server-side programming language known
 20 million web servers over world has installed PHP support
 Free of cost LAMP stack instead of Microsoft stack costing lots of dollars for WISC
Popularity of PHP


Rapid web application development for small to medium sized websites due to lots of open
source frameworks available
CMS
Joomla , Drupal , Moodle etc
Blog
Wordpress
Forum
PHPBB , vBulletin etc
CRM
SugarCRM
Ecommerce
Magento , Oscommerce , Zen cart etc



Around 20 Advanced Object Oriented Frameworks available which uses complex design
patterns and structured design which can be used for large size robust software
development
How PHP Works
Two ways to install PHP
1. PHP as apache module
When PHP runs as an Apache module, it is compiled into the Apache code itself. This
means, when an Apache process starts, PHP starts along with it. They are intrinsically linked,
and PHP depends on Apache to operate. The benefit of this is that Apache tends to run very
efficiently, and PHP is part of each Apache process. Furthermore, Apache configuration,
particularly when using .htaccess files, can also be used to control PHP functions
2. PHP as a CGI script
PHP as a CGI script means that PHP operates as an independent binary with its own
processes. It is separate from Apache and can, therefore, run as another user, rather than
Apache’s generic user. This increases security and adds a bit of stability, at the expense of
speed
How PHP Works
•
•
•
•
•
•
•

•

We never start any PHP daemon or anything by our self , When we start Apache it starts
PHP interpreter along itself
PHP is linked to apache (Using SAPI) by mode_php.so or mode_php.dll
PHP as a whole consists of 3 modules
(Core PHP , Zend Engine and Extension layer)
Core PHP is the module which handles the requests , file streams , error handling etc
Zend engine is one which converts human readable code into machine understandable
opcodes , Then It executes this general code into virtual machine
Extensions are bunch of functions , classes , streams made available to PHP scripts , For
example we need mysql extension to connect to mysql database using PHP
While zend engine executes the generated code , the script might require access to few
extensions , Then ZE passes control to extension module/layer which transfers back the
control to ZE after completion of tasks.
The PHP language is interpreted. The binary that lets you interpret PHP is compiled. Means
PHP is compiled down to an intermediate bytecode that is then interpreted by the runtime
engine
Basics of PHP
1.
2.

Readymade packages is available for windows or Mac Os named WAMP , MAMP
XAMPP is available for all platforms which is package of PHP , MySQL , apache , Tomcat ,
PhpMyadmin , Sqlite
3.
LAMP requires separate configuration for all components
4.
There are lots of PHP configurations which can be changed from PHP.ini file
5.
PHP.ini settings can be changed in three ways
• Directly in php.ini file
• htaccess file
• In PHP scripts using ini_set function
6.
Which parameter valid to be changed depends upon changeable flag of parameter
7.
PHP_INI_ALL type can be changed from anywhere
8.
PHP_INI_PERDIR can be changed from .htaccess or php.ini
9.
php.ini only can be changed only in php.ini file
10. If you change parameter which is not changeable from there then It’s value won’t affect.
Example - short_open_tag can’t affect it’s change if done by ini_set function
Basics of PHP
11. httpd.conf is configuration file of Apache server
12. You can change any settings related to requests to servers , configurations of Virtual hosting ,
Directory specific permissions , URL rewrite , Error logs settings , Adding new apache
modules , Authorization etc
13. httpd.conf settings can also be changed from per directory basis by .htaccess file
14. .htaccess file is apache’s directory basis configration file which can do following
•
Authorization and Authetication
•
Rewriting URLs
•
Blocking
•
Error responses
•
Cache control
15. Loosely coupled language
16. Free from declaring type of variables and don’t require to define function definition before
declaring it (Developer is free to pass any type of variable to function at run time)
17. Support for default function arguments
Basics of PHP
18.
19.
20.
21.
22.
23.
24.

Provides complex data types in form of Arrays , Objects , Resources
Output buffering can easily be set and can clean buffer by sending contents to browser in
chuck of processes or either at end of script
Modify HTTP response headers any parameter like sending redirect , content type , setting
cookies etc
$_GET , $_POST , $_SESSION , $_COOKIE , $_REQUEST , $_SERVER super global variables
session.save_handler php.ini configuration can set where sessions will be stored on server ,
default is file but can be saved in Database as well
session.save_path used to set path on file system for storing session data
session_id is unique session seed and it’s value is stored on cookie on client side , If cookie
will be disabled on client side then it will pass it to URLs
Versions of PHP








Latest PHP release is 5.4.4
PHP5 for the most part is backwards compatible with PHP4, but there are a couple key
changes that might break your PHP4 script in a PHP5
Advanced OOP concepts has been added from version 5 , version 4 was having limited
OOP support
Exceptions introduced in version 5 in PHP
E_STRICT error level added in version 5 (Deprecated code usage give warning)
Useful extensions like SimpleXML , DOM , XSL , PDO , Hash , Curl and lot may more has
been added in version 5 onwards
Xdebug powerful extension for debugging PHP and PHPUnit for automated test cases unit
testing extension added from version 5 onwards

More Related Content

What's hot

What's hot (20)

Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
Php ppt
Php pptPhp ppt
Php ppt
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHP presentation - Com 585
PHP presentation - Com 585PHP presentation - Com 585
PHP presentation - Com 585
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php presentation
Php presentationPhp presentation
Php presentation
 
Php(report)
Php(report)Php(report)
Php(report)
 
Writing php extensions in golang
Writing php extensions in golangWriting php extensions in golang
Writing php extensions in golang
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Php
PhpPhp
Php
 

Similar to How PHP works (20)

Php unit i
Php unit i Php unit i
Php unit i
 
Php intro
Php introPhp intro
Php intro
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Report.docx
Report.docxReport.docx
Report.docx
 
24307183 php
24307183 php24307183 php
24307183 php
 
Php
PhpPhp
Php
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Wc13
Wc13Wc13
Wc13
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php ppt
Php pptPhp ppt
Php ppt
 
PHP
PHPPHP
PHP
 
PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
 
What is PHP?
What is PHP?What is PHP?
What is PHP?
 
Php notes
Php notesPhp notes
Php notes
 
PHP Course and Training
PHP Course and Training PHP Course and Training
PHP Course and Training
 
Php Training in Chandigarh
Php Training in ChandigarhPhp Training in Chandigarh
Php Training in Chandigarh
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
PhP Training Institute In Delhi
PhP Training Institute In DelhiPhP Training Institute In Delhi
PhP Training Institute In Delhi
 
Applied+Web+Development+[Autosaved].pptx
Applied+Web+Development+[Autosaved].pptxApplied+Web+Development+[Autosaved].pptx
Applied+Web+Development+[Autosaved].pptx
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 

More from Atlogys Technical Consulting

BDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesBDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesAtlogys Technical Consulting
 
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)Atlogys Technical Consulting
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkAtlogys Technical Consulting
 
Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys Technical Consulting
 

More from Atlogys Technical Consulting (20)

Latest UI guidelines for Web Apps
Latest UI guidelines for Web AppsLatest UI guidelines for Web Apps
Latest UI guidelines for Web Apps
 
Discipline at Atlogys
Discipline at AtlogysDiscipline at Atlogys
Discipline at Atlogys
 
Reprogram your mind for Positive Thinking
Reprogram your mind for Positive ThinkingReprogram your mind for Positive Thinking
Reprogram your mind for Positive Thinking
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
Tests for Scalable, Fast, Secure Apps
Tests for Scalable, Fast, Secure AppsTests for Scalable, Fast, Secure Apps
Tests for Scalable, Fast, Secure Apps
 
Atomic Design with PatternLabs
Atomic Design with PatternLabsAtomic Design with PatternLabs
Atomic Design with PatternLabs
 
Git and Version Control at Atlogys
Git and Version Control at AtlogysGit and Version Control at Atlogys
Git and Version Control at Atlogys
 
Guidelines HTML5 & CSS3 - Atlogys (2018)
Guidelines HTML5 & CSS3 - Atlogys (2018)Guidelines HTML5 & CSS3 - Atlogys (2018)
Guidelines HTML5 & CSS3 - Atlogys (2018)
 
Rabbit MQ - Tech Talk at Atlogys
Rabbit MQ - Tech Talk at Atlogys Rabbit MQ - Tech Talk at Atlogys
Rabbit MQ - Tech Talk at Atlogys
 
BDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesBDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy Series
 
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
 
How Solr Search Works
How Solr Search WorksHow Solr Search Works
How Solr Search Works
 
Wordpress Tech Talk
Wordpress Tech Talk Wordpress Tech Talk
Wordpress Tech Talk
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
Atlogys Academy - Tech Talk on Mongo DB
Atlogys Academy - Tech Talk on Mongo DBAtlogys Academy - Tech Talk on Mongo DB
Atlogys Academy - Tech Talk on Mongo DB
 
Atlogys Tech Talk - Web 2.0 Design Guidelines
Atlogys Tech Talk - Web 2.0 Design GuidelinesAtlogys Tech Talk - Web 2.0 Design Guidelines
Atlogys Tech Talk - Web 2.0 Design Guidelines
 
Firebase Tech Talk By Atlogys
Firebase Tech Talk By AtlogysFirebase Tech Talk By Atlogys
Firebase Tech Talk By Atlogys
 
Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!
 
Smart CTO Service
Smart CTO ServiceSmart CTO Service
Smart CTO Service
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

How PHP works

  • 1. PHP Tech Talk Presented By: Jignasha Vithalani
  • 2. What is PHP Overview: • Server side scripting language • Dynamic web page generation • Open source (PHPLicense incompatible with GPL) • Free • Cross platform • recursive acronym of Hypertext preprocessor which was previously Personal Home Page whose syntax borrowed mostly from Perl
  • 3. What PHP can do PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more As HTML can be mixed with PHP scripts which will be executed on server side , It will be less overhead to output HTML like in C or Perl There are three main areas where PHP scripts are used 1) Server-side scripting You need three things to make this work. The PHP parser (CGI or server module), a web server and a web browser. You need to run the web server, with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page through the server
  • 4. What PHP can do 2) Command line scripting You can make a PHP script to run it without any server or browser. You only need the PHP parser to use it this way. This type of usage is ideal for scripts regularly executed using cron (on *nix or Linux) or Task Scheduler (on Windows). These scripts can also be used for simple text processing tasks 3) Writing desktop applications PHP is probably not the very best language to create a desktop application with a graphical user interface, but if you know PHP very well, and would like to use some advanced PHP features in your client-side applications you can also use PHP-GTK to write such programs. You also have the ability to write cross-platform applications this way
  • 5. Flexibility of PHP 1) 2) 3) 4) 5) PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, and probably others PHP has also support for most of the web servers today. This includes Apache, IIS, lighttpd and many others , And this includes any web server that can utilize the FastCGI PHP binary, like lighttpd and nginx. You have the choice of using procedural programming or object oriented programming (OOP), or a mixture of them both With PHP you are not limited to output HTML. PHP's abilities includes outputting images, PDF files and even Flash movies (using libswf and Ming) generated on the fly. You can also output easily any text, such as XHTML and any other XML file. Most significant features in PHP is its support for a wide range of database. Writing a database-enabled web page is incredibly simple using one of the database specific extensions (e.g., for mysql), or using an abstraction layer like PDO, or connect to any database supporting the Open Database Connection standard via the ODBC extension
  • 6. Flexibility of PHP 1) PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and countless others. You can also open raw network sockets and interact using any other protocol. PHP has support for the WDDX complex data exchange between virtually all Web programming languages. Talking about interconnection, PHP has support for instantiation of Java objects and using them transparently as PHP objects. 2) PHP has useful text processing features, which includes the Perl compatible regular expressions (PCRE), and many extensions and tools to parse and access XML documents. PHP standardizes all of the XML extensions on the solid base of libxml2, and extends the feature set adding SimpleXML, XMLReader and XMLWriter support. 3) Availability of various extensions and modules for different features and reusable codes 4) As source code is available It can be modified according to program need and PHP can then be recompiled for generating PHP binary 5) New Extension can easily be added which can either be dynamically linked or linked with Zend engine
  • 7. Popularity of PHP  6 out of 10 most popular websites of world has used PHP Website Popularity(unique visitors) Gooogle.com 1,000,000,000 Facebook.com 880,000,000 Youtube.com 800,000,000 Yahoo 590,000,000 Wikipedia.org 410,000,000 Wordpress.com 130,000,000  PHP is used by 77.8% of all the websites whose server-side programming language known  20 million web servers over world has installed PHP support  Free of cost LAMP stack instead of Microsoft stack costing lots of dollars for WISC
  • 8. Popularity of PHP  Rapid web application development for small to medium sized websites due to lots of open source frameworks available CMS Joomla , Drupal , Moodle etc Blog Wordpress Forum PHPBB , vBulletin etc CRM SugarCRM Ecommerce Magento , Oscommerce , Zen cart etc  Around 20 Advanced Object Oriented Frameworks available which uses complex design patterns and structured design which can be used for large size robust software development
  • 9. How PHP Works Two ways to install PHP 1. PHP as apache module When PHP runs as an Apache module, it is compiled into the Apache code itself. This means, when an Apache process starts, PHP starts along with it. They are intrinsically linked, and PHP depends on Apache to operate. The benefit of this is that Apache tends to run very efficiently, and PHP is part of each Apache process. Furthermore, Apache configuration, particularly when using .htaccess files, can also be used to control PHP functions 2. PHP as a CGI script PHP as a CGI script means that PHP operates as an independent binary with its own processes. It is separate from Apache and can, therefore, run as another user, rather than Apache’s generic user. This increases security and adds a bit of stability, at the expense of speed
  • 10. How PHP Works • • • • • • • • We never start any PHP daemon or anything by our self , When we start Apache it starts PHP interpreter along itself PHP is linked to apache (Using SAPI) by mode_php.so or mode_php.dll PHP as a whole consists of 3 modules (Core PHP , Zend Engine and Extension layer) Core PHP is the module which handles the requests , file streams , error handling etc Zend engine is one which converts human readable code into machine understandable opcodes , Then It executes this general code into virtual machine Extensions are bunch of functions , classes , streams made available to PHP scripts , For example we need mysql extension to connect to mysql database using PHP While zend engine executes the generated code , the script might require access to few extensions , Then ZE passes control to extension module/layer which transfers back the control to ZE after completion of tasks. The PHP language is interpreted. The binary that lets you interpret PHP is compiled. Means PHP is compiled down to an intermediate bytecode that is then interpreted by the runtime engine
  • 11. Basics of PHP 1. 2. Readymade packages is available for windows or Mac Os named WAMP , MAMP XAMPP is available for all platforms which is package of PHP , MySQL , apache , Tomcat , PhpMyadmin , Sqlite 3. LAMP requires separate configuration for all components 4. There are lots of PHP configurations which can be changed from PHP.ini file 5. PHP.ini settings can be changed in three ways • Directly in php.ini file • htaccess file • In PHP scripts using ini_set function 6. Which parameter valid to be changed depends upon changeable flag of parameter 7. PHP_INI_ALL type can be changed from anywhere 8. PHP_INI_PERDIR can be changed from .htaccess or php.ini 9. php.ini only can be changed only in php.ini file 10. If you change parameter which is not changeable from there then It’s value won’t affect. Example - short_open_tag can’t affect it’s change if done by ini_set function
  • 12. Basics of PHP 11. httpd.conf is configuration file of Apache server 12. You can change any settings related to requests to servers , configurations of Virtual hosting , Directory specific permissions , URL rewrite , Error logs settings , Adding new apache modules , Authorization etc 13. httpd.conf settings can also be changed from per directory basis by .htaccess file 14. .htaccess file is apache’s directory basis configration file which can do following • Authorization and Authetication • Rewriting URLs • Blocking • Error responses • Cache control 15. Loosely coupled language 16. Free from declaring type of variables and don’t require to define function definition before declaring it (Developer is free to pass any type of variable to function at run time) 17. Support for default function arguments
  • 13. Basics of PHP 18. 19. 20. 21. 22. 23. 24. Provides complex data types in form of Arrays , Objects , Resources Output buffering can easily be set and can clean buffer by sending contents to browser in chuck of processes or either at end of script Modify HTTP response headers any parameter like sending redirect , content type , setting cookies etc $_GET , $_POST , $_SESSION , $_COOKIE , $_REQUEST , $_SERVER super global variables session.save_handler php.ini configuration can set where sessions will be stored on server , default is file but can be saved in Database as well session.save_path used to set path on file system for storing session data session_id is unique session seed and it’s value is stored on cookie on client side , If cookie will be disabled on client side then it will pass it to URLs
  • 14. Versions of PHP        Latest PHP release is 5.4.4 PHP5 for the most part is backwards compatible with PHP4, but there are a couple key changes that might break your PHP4 script in a PHP5 Advanced OOP concepts has been added from version 5 , version 4 was having limited OOP support Exceptions introduced in version 5 in PHP E_STRICT error level added in version 5 (Deprecated code usage give warning) Useful extensions like SimpleXML , DOM , XSL , PDO , Hash , Curl and lot may more has been added in version 5 onwards Xdebug powerful extension for debugging PHP and PHPUnit for automated test cases unit testing extension added from version 5 onwards