PHP 7.2, which is the latest second feature update to the PHP 7 series, is now available as a one-click install in our control panel!

While it has been installed on our CentOS 7 servers for a few weeks now, you should now be able to create new apps using our control panel by selecting the Static/CGI/PHP-7.2 option in the App Type dropdown menu.

Screenshot of WebFaction control panel php version picker

If you want to run a php script from the command line, like composer or drush, you can invoke the php 7.2 interpreter as php72.

[iliasr@web624 ~]$ php72 -v
PHP 7.2.1 (cli) (built: Jan  5 2018 04:43:31) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

Eager users (and there were a few judging from the support tickets about it) were able to use PHP 7.2 by manually putting this in their site’s .htaccess file:

<FilesMatch .php$>
    SetHandler php72-cgi
</FilesMatch>

If you want to switch an existing PHP app to PHP 7.2 you will need to do the same. While there are only a few backward incompatible changes with this release, it would be wise to review the official migration guide before doing so.

PHP 7.2 brings a lot of impromvements and new features such as the ability to convert numeric keys in object/array casts, the migration of the Hash extension from Resource to Object and the introduction of libsodium as a core extension. You can review the full list of changes in the official ChangeLog.

Please note that PHP 7.2 is not available on our CentOS 6 servers (any machine lower than Web500). Users on CentOS 6 who wish to install and use PHP 7.2 apps must migrate to a CentOS 7 server.