• Migrating to PHP 7.1

    Migrating to PHP 7.1

    Today I updated the version of PHP I use in my development environment, from PHP 7.0.7 to PHP 7.1.1.

    Background

    • PHP 7.1 was released on 1 Dec 2016.
    • It’s supposed to be faster than 7.0.
    • Hosting companies such as SiteGround already support PHP 7.1.
    • WordPress 4.7 supports PHP 7.1.
    • So my plugins and themes should do too.

    Steps

    Original environment: Windows 10, Apache 2.4, MySQL something and PHP 7.0.7.

    • Download the ZIP file ( Thread safe 64-bit )
    • Unpack to a new directory C:\PHP71
    • Copy and cobble the php.ini file from C:\PHP7
    • Change Apache configuration to reflect new directory
    • Change PATH system environment variable to reflect new directories ( C:\PHP71;C:\PHP71\EXT )
    • Restart Apache
    • Test that PHP 7.1 works
    • Reboot
    • Test plugins and themes
    • Fix any problems
    C:\php71>php -v
    PHP 7.1.1 (cli) (built: Jan 18 2017 18:38:49) ( ZTS MSVC14 (Visual C++ 2015) x64 )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.1.1, Copyright (c) 1999-2017, by Zend Technologies
    

    Problems

    It should have been straightforward but I forgot to change the PATH so, when trying to restart the Apache server, I was getting lots of messages about functions which could not be found in DLLs.

    I also thought it would be nice to be able to run multiple versions of PHP concurrently. SiteGround hosting does it by changing .htaccess.

    #AddHandler application/x-httpd-php70 .php .php5 .php4 .php3
    AddHandler application/x-httpd-php71 .php .php5 .php4 .php3
    

    It doesn’t seem to be so easy in Windows.

    Conclusion

    So far, the places where I’ve seen problems have been:

    Problem Fix & Reference
    Warning: Parameter 1 to wp_default_styles() expected to be a reference Upgrade to WordPress 4.7.x
    Fatal error: Cannot use $this as parameter Rename $this
    bobbingwide/oik-types#7
    Warning: Illegal string offset ‘field_name’ Ensure we’re using an array
    bobbingwide/oik-bob-bing-wide#17
    Ditto Cast $atts to array
    bobbingwide/oik#64
    Notice: tempnam(): file created in the system’s temporary directory Created the directory it needed bobbingwide/oik-shortcodes#47
    Jetpack 4.4.2 produces 500 internal server error Upgrade to Jetpack 4.7

    , ,

    Published:

    Last updated:

    March 13, 2017

Today’s word is this:

Friday

Food-le.com

aspic

Foodlewordle.io

ranch

Categories

Tide times from tidetimes.org.uk

Tide Times & Heights for Langstone Harbour on
24th May 2024
00:39 High Tide ( 4.72m )
05:52 Low Tide ( 1.15m )
13:04 High Tide ( 4.63m )
18:10 Low Tide ( 1.25m )

Tide times from tidetimes.org.uk

Tide Times & Heights for Northney on
24th May 2024
00:44 High Tide ( 4.4m )
05:50 Low Tide ( 0.77m )
13:11 High Tide ( 4.31m )
18:05 Low Tide ( 0.97m )