UPGRADING TO PHP 5.6LUKA SKUPNJAK, ZGPHP #42
WHY UPGRADING
WHY UPGRADING - SPEED
image taken from Dmitry Stogov
WHY UPGRADING - SPEED
image taken from Dmitry Stogov
PHP ≤ 5.3 IS DEAD
WHY UPGRADING - CODE
symfony/Console
symfony/DependencyInjection
symfony/EventDispatcher
illuminate/database
domnikl/statsd-php
facebook/facebook-php-sdk-v4
"require": { "php": ">= 5.5.9"}
"require": { "php": ">= 5.5.9"}
"require": { "php": ">= 5.4.0"}
"require": { "php": ">= 5.4.0"}
"require": { "php": ">= 5.4.0"}
"require": { "php": ">= 5.4.0"}
HOW TO UPGRADE
php.net migration manual
Upgrade from PHP 5.3 to PHP 5.4
Upgrade from PHP 5.4 to PHP 5.5
Upgrade from PHP 5.5 to PHP 5.6
HOW TO UPGRADE - NO DOWNTIME
Upgrade just the part of the server cluster
Fix version specific errors
Upgrade everything
See Tomislav's talk from ZgPHP #41!
SENTRY
Single point to track all errors
Supports error filtering and aggregating
One installation manages your test, staging and production servers
Get from Github through Composer
SENTRY
SENTRY - PRO TIPS
Raven Client captureException method - add tags to options array (PHP version, server address)
Raven Error Handler handleFatalError method - add E_DEPRECATED and E_USER_DEPRECATED error handleing
EXTRAS - SESSIONS
From PHP 5.6 session data is only written if data has been changed.
This can cause some weird problems, like "randomly" logging out of users
Solution: write something every time
Read more here
$_SESSION['someKey'] = some_changeable_value; // time()
EXTRAS - $HTTP_RAW_POST_DATA
Deprecated from PHP 5.6
setting in php.ini defines how data is written in
Solution:
always_populate_raw_post_data$HTTP_RAW_POST_DATA
always_populate_raw_post_data = ‐1
THANK YOU
Please rate my talk!
We're hiring!
https://joind.in/13602
http://www.trikoder.hr/karijera/