Today I updated the version of PHP I use in my development environment, from PHP 7.0.7 to PHP 7.1.1.
- 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.
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
- 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
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
#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.
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|
|Warning: Illegal string offset ‘field_name’||Ensure we’re using an array|
|Ditto||Cast $atts to array|
|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|