15

Upgrading to php 5.6

Embed Size (px)

Citation preview

Page 1: Upgrading to php 5.6
Page 2: Upgrading to php 5.6

UPGRADING TO PHP 5.6LUKA SKUPNJAK, ZGPHP #42

Page 3: Upgrading to php 5.6

WHY UPGRADING

Page 4: Upgrading to php 5.6

WHY UPGRADING - SPEED

image taken from Dmitry Stogov

Page 5: Upgrading to php 5.6

WHY UPGRADING - SPEED

image taken from Dmitry Stogov

Page 6: Upgrading to php 5.6

PHP ≤ 5.3 IS DEAD

Page 7: Upgrading to php 5.6

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"}

Page 8: Upgrading to php 5.6

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

Page 9: Upgrading 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!

Page 10: Upgrading to php 5.6

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

Page 11: Upgrading to php 5.6

SENTRY

Page 12: Upgrading to php 5.6

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

Page 13: Upgrading to php 5.6

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()

Page 14: Upgrading to php 5.6

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

Page 15: Upgrading to php 5.6

THANK YOU

Please rate my talk!

We're hiring!

https://joind.in/13602

http://www.trikoder.hr/karijera/