SlideShare a Scribd company logo
ZEND SERVER: NOT JUST A PHP STACK
JEROEN VAN DIJK
@JRVANDIJK
BOARD MEMBER
Zend Server: Not just a PHP stack
NETHERLANDS 
UNITED 
KINGDOM 
BELGIUM 
GERMANY 
AMSTERDAM
NETHERLANDS 
UNITED 
KINGDOM 
BELGIUM 
GERMANY 
AMSTERDAM 
NOT AMSTERDAM
NETHERLANDS 
UNITED 
KINGDOM 
BELGIUM 
GERMANY 
AMERSFOORT
ENRISE HEADQUARTERS
SERVING PHP APPS
WHO’S DOING MANUAL COMPILE OF PHP?
WHO’S USING STOCK DISTRO VERSIONS?
WHO’S USING OTHER STACKS? 
IN PRODUCTION?
WRITING YOUR OWN CODE
COMPOSING JSON FILES
Zend Server: Not just a PHP stack
GUZZLE 
TWIG 
MONOLOG 
SWIFTMAILER 
DOCTRINE 
ROUTING 
PHPUNIT 
YAML 
CODECEPTION 
EVENTMANAGER
SHIP & DEPLOY
MONITORING
SIMPLE SILEX EXAMPLE 
<?php 
require_once __DIR__ . '/../vendor/autoload.php'; 
$app = new SilexApplication(); 
$app->get('/slowrequest', function() use($app) { 
sleep(5); 
return $app->json(array('That was slow')); 
}); 
$app->run();
TRIGGERED EVENTS
BASIC CONFIG
THRESHOLD CONFIG
LOGGING A CUSTOM EVENT 
$app = new SilexApplication(); 
$app->get('/slowrequest', function() use($app) { 
if (function_exists('zend_monitor_custom_event')) { 
zend_monitor_custom_event( 
'Internal Application Error', 
'your error message', 
array( 
'trace' => 'this went wrong' 
) 
); 
} 
return $app->json(array('That was slow')); 
});
1 
ALTERNATIVE: NEW RELIC
CODETRACING & PROFILING
DETAILED INSPECTION
MY PREFERRED METHOD
WARNING! 
GREAT POWER == GREAT RESPONSIBILITY 
ENABLED FOR LIMITED TIME 
MAXIMUM CODETRACING FILE SIZE
2 
ALTERNATIVE: XHPROF
DEBUGGING
VDD 
VAR_DUMP DRIVEN DEVELOPMENT
VDD 
VAR_DUMP DRIVEN DEVELOPMENT
DEBUGGER COMMUNICATION 
LOCALHOST:20080 
& DEBUG_PORT=10137 & DEBUG_HOST=172.17.0.199,127.0.0.1
DEBUGGER CONFIG
ENABLE BROWSER DEBUGGING 
§ Chrome zDebug extension 
§ Jetbrains bookmarklets 
§ https://www.jetbrains.com/phpstorm/marklets/ 
§ Zend debugger toolbar
DEBUG SESSION
DEBUG LOGGED EVENT
REMOTE DEBUGGING 
SSH -L <USER> -R 10137:LOCALHOST:10137 <HOST>
3 
ALTERNATIVE: XDEBUG
Z-RAY
DEBUG TOOLBARS 
§ WordPress debug bar 
§ Zend Framework 2 developer tools 
§ Symfony 2 web profiler 
§ Yii debug toolbar 
§ …. 
§ ….
DEBUG TOOLBARS 
§ WordPress debug bar 
§ Zend Framework 2 developer tools 
§ Symfony 2 web profiler 
§ Yii debug toolbar 
§ …. 
§ ….
Z-RAY TOOLBAR
Z-RAY TOOLBAR
Z-RAY TOOLS IN ADMIN
Z-RAY TOOLS IN ADMIN
4 
ALTERNATIVE: ???
ONE MORE THING
QUEUEING 
THE EASY WAY
MOVE SLOW REQUEST INTO JOB 
$app->get('/slowrequest', function() use($app) { 
$queue = new ZendJobQueue(); 
$queue->createHttpJob('/sendemail', array( 
'email'=>'jeroen@enrise.com'), 
array('name'=>'Send email') 
); 
return $app->json(array('That wasn't slow')); 
}); 
$app->post('/sendemail', function() use ($app) { 
sleep(5); 
$params = ZendJobQueue::getCurrentJobParams(); 
ZendJobQueue::setCurrentJobStatus(ZendJobQueue::OK); 
$response = new Response(); 
$response->headers->set('X-Info', 'mail send to '. $params['email']); 
return $response; 
});
Zend Server: Not just a PHP stack
SECURING JOB ACTIONS 
/** 
* See Matthew Weier O'Phinney his blog serie about 
* Zend Server 
* 
* https://mwop.net/blog/2014-09-04-zend-server-deployment- 
* part-4.html 
*/ 
if (! ZendJobQueue::getCurrentJobId()) { 
header('HTTP/1.1 403 Forbidden'); 
exit(1); 
}
SCHEDULE A JOB
AS SOON AS POSSIBLE 
$queue = new ZendJobQueue(); 
// send the as soon as possible 
$queue->createHttpJob('/sendemail', 
array('email'=>'jeroen@enrise.com'), 
array( 
'name'=>'Send email', 
'priority' => ZendJobQueue::PRIORITY_URGENT 
) 
);
AT A SPECIFIC TIME 
$queue = new ZendJobQueue(); 
// send the email tomorrow 2am 
$queue->createHttpJob('/sendemail', 
array('email'=>'jeroen@enrise.com'), 
array( 
'name'=>'Send email', 
'schedule_time' => date('Y-m-d h:i:s', 
strtotime('tomorrow 2am')) 
) 
);
RECURRING 
$queue = new ZendJobQueue(); 
// send the email every Monday at 2am 
$queue->createHttpJob('/sendemail', 
array('email'=>'jeroen@enrise.com'), 
array( 
'name'=>'Send email', 
'schedule' => '0 2 * * 1' 
) 
);
MANY MORE THINGS
JAVA BRIDGE 
LIBRARIES 
OPCODE CACHING 
CLUSTERING 
APPLICATIONS 
WEB API 
PAGE CACHING 
VIRTUAL HOSTS 
DATA CACHING 
CONTINUOUS DELIVERY
JOIND.IN/12081

More Related Content

PPT
Slim RedBeanPHP and Knockout
PDF
Hello World on Slim Framework 3.x
PDF
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
KEY
Keeping it small: Getting to know the Slim micro framework
PDF
Clear php reference
PDF
第26回PHP勉強会
PDF
Bullet: The Functional PHP Micro-Framework
PPT
symfony & jQuery (phpDay)
Slim RedBeanPHP and Knockout
Hello World on Slim Framework 3.x
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...
Keeping it small: Getting to know the Slim micro framework
Clear php reference
第26回PHP勉強会
Bullet: The Functional PHP Micro-Framework
symfony & jQuery (phpDay)

What's hot (20)

PDF
Adventures in Laravel and Performance: Looking beyond eloquent
PDF
4.2 PHP Function
PDF
Perl web frameworks
KEY
And the Greatest of These Is ... Rack Support
KEY
Mojo as a_client
PDF
Developing apps using Perl
KEY
Silex, the microframework
PPTX
Zephir - A Wind of Change for writing PHP extensions
PPTX
Flying under the radar
PDF
Silex and Twig (PHP Dorset talk)
PPT
Introduction To Lamp
ODP
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
PPT
PHP and COM
PDF
CodePolitan Webinar: The Rise of PHP
KEY
BDD with Behat and Symfony2
PDF
RESTful web services
PPT
Tadhack madrid June 2014: Joris Swinnen and WebRTC Nederland "Invite my colle...
PDF
Desenvolvendo APIs usando Rails - Guru SC 2012
ZIP
Web Apps in Perl - HTTP 101
PDF
The Enterprise Wor/d/thy/Press
Adventures in Laravel and Performance: Looking beyond eloquent
4.2 PHP Function
Perl web frameworks
And the Greatest of These Is ... Rack Support
Mojo as a_client
Developing apps using Perl
Silex, the microframework
Zephir - A Wind of Change for writing PHP extensions
Flying under the radar
Silex and Twig (PHP Dorset talk)
Introduction To Lamp
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
PHP and COM
CodePolitan Webinar: The Rise of PHP
BDD with Behat and Symfony2
RESTful web services
Tadhack madrid June 2014: Joris Swinnen and WebRTC Nederland "Invite my colle...
Desenvolvendo APIs usando Rails - Guru SC 2012
Web Apps in Perl - HTTP 101
The Enterprise Wor/d/thy/Press
Ad

Viewers also liked (6)

PDF
Technology Fast 500
PDF
To SQL or No(t)SQL - PFCongres 2012
PDF
Liking Relevance - PHP North East 2014
PDF
56.Synthesis, Characterization and Antibacterial activity of iron oxide Nanop...
PDF
Front-End Optimization (FEO)
PDF
Varnish Configuration Step by Step
Technology Fast 500
To SQL or No(t)SQL - PFCongres 2012
Liking Relevance - PHP North East 2014
56.Synthesis, Characterization and Antibacterial activity of iron oxide Nanop...
Front-End Optimization (FEO)
Varnish Configuration Step by Step
Ad

Similar to Zend Server: Not just a PHP stack (20)

KEY
PDF
Lean Php Presentation
PDF
Node js introduction
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
PDF
関西PHP勉強会 php5.4つまみぐい
ODP
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
PDF
Nette framework (WebElement #28)
PDF
WCLA12 JavaScript
PDF
Building Testable PHP Applications
KEY
Zend Framework Study@Tokyo #2
PDF
Ch ch-changes cake php2
PPTX
REST API for your WP7 App
KEY
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
PDF
Symfony 2 (PHP Quebec 2009)
PDF
Zend Framework Components for non-framework Development
PDF
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
PDF
The Enterprise Wor/d/thy/Press
PDF
Curso Symfony - Clase 4
PDF
Creating native apps with WordPress
PPTX
Design patterns as power of programing
Lean Php Presentation
Node js introduction
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
関西PHP勉強会 php5.4つまみぐい
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Nette framework (WebElement #28)
WCLA12 JavaScript
Building Testable PHP Applications
Zend Framework Study@Tokyo #2
Ch ch-changes cake php2
REST API for your WP7 App
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Symfony 2 (PHP Quebec 2009)
Zend Framework Components for non-framework Development
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
The Enterprise Wor/d/thy/Press
Curso Symfony - Clase 4
Creating native apps with WordPress
Design patterns as power of programing

More from Jeroen van Dijk (12)

PDF
WordPress REST API hacking
PDF
WordPress REST API hacking
PDF
Beacons in Appcelerator Titanium
PDF
Teaming up WordPress API with Backbone.js in Titanium
PDF
Teaming up WordPress API with Backbone.js in Titanium
PDF
An app on the shoulders of giants
PDF
Refactoring using Codeception
PDF
To SQL or No(t)SQL - PHPNW12
PDF
Socializing a world of travel
PDF
Varnish, the high performance valhalla?
PPTX
Varnish, the high performance valhalla?
PPTX
Edge Side Includes in Zend Framework without Varnish
WordPress REST API hacking
WordPress REST API hacking
Beacons in Appcelerator Titanium
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
An app on the shoulders of giants
Refactoring using Codeception
To SQL or No(t)SQL - PHPNW12
Socializing a world of travel
Varnish, the high performance valhalla?
Varnish, the high performance valhalla?
Edge Side Includes in Zend Framework without Varnish

Recently uploaded (20)

PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Testing WebRTC applications at scale.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPT
tcp ip networks nd ip layering assotred slides
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PDF
Introduction to the IoT system, how the IoT system works
PPTX
Introduction to Information and Communication Technology
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
DOCX
Unit-3 cyber security network security of internet system
introduction about ICD -10 & ICD-11 ppt.pptx
Testing WebRTC applications at scale.pdf
SAP Ariba Sourcing PPT for learning material
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
RPKI Status Update, presented by Makito Lay at IDNOG 10
international classification of diseases ICD-10 review PPT.pptx
Paper PDF World Game (s) Great Redesign.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
INTERNET------BASICS-------UPDATED PPT PRESENTATION
An introduction to the IFRS (ISSB) Stndards.pdf
tcp ip networks nd ip layering assotred slides
Slides PDF The World Game (s) Eco Economic Epochs.pdf
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Introduction to the IoT system, how the IoT system works
Introduction to Information and Communication Technology
Cloud-Scale Log Monitoring _ Datadog.pdf
Job_Card_System_Styled_lorem_ipsum_.pptx
Unit-3 cyber security network security of internet system

Zend Server: Not just a PHP stack