Following the [[http://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html|strategy announcement by the HHVM team]] and [[https://lists.wikimedia.org/pipermail/wikitech-l/2017-September/088784.html|subsequent discussion on wikitech-l]], including [[https://lists.wikimedia.org/pipermail/wikitech-l/2017-September/088854.html|benchmarks indicating HHVM no longer has a performance advantage]], it is proposed that we migrate the WMF MediaWiki appservers from HHVM to PHP 7.
The current plan involves first migrating the appservers from jessie to stretch (T174431).
## High-level checklist
Phase 1: PHP 7 and extensions/integrations installed:
* [x] PHP 7 available via command-line on all mw servers (e.g. maintenance scripts).
* [ ] PHP 7 available on all mw servers via php-fpm.
Phase 2: PHP 7 interaction with MediaWiki
(Features to be installed, tested, and known to work correctly; any behaviour/config differences between PHP7 and HHVM to be equalised or justified+documented):
* [x] Memcached client works with MW.
* [ ] APCu works with MW.
* [ ] mysqli driver works with MW.
* [ ] Debug profiling works with MW (e.g. xhprof, or tideways) – T176916
* [ ] Sampling profiling works with MW. – T176916
* [ ] Error and fatal error reporting works with MW. – T187147
* [ ] Post-send functions works with MW.
* [ ] Any misc issues blocking MW at #php_7.0_support and #php_7.1_support.
PHP 7 on by default:
* [ ] For mwscript on maintenance and deployment hosts.
* [ ] For users with Beta Feature enabled, on any web/api appserver.
* [ ] For job runners and video scalers.
* [ ] For web appservers and api appservers.
### Summary
>>! In T176370#3651860, @faidon wrote:
> Taking into account the lack funding for appserver work, as well as the end of the year fundraising and Christmas freezes, the (tentative!) timeline I proposed is:
> - Upgrade the appserver fleet (w/ HHVM) to Debian stretch, including the ICU migration, in Q3 FY17-18 (circa February/March 2018)
> - Begin PHP7 planning and initial implementation work in Q4 FY17-18, e.g. including a few test servers
> - Fund the work in FY18-19 and complete it early in the year (Q1 or Q2 at the latest)
>
> That's from an #ops perspective -- I think other tasks related to this migration (such as CI, beta, code/extension changes etc.) can proceed semi-independently. Given our velocity, I think we'll end up be the ones blocking others, rather than us waiting on these.
>>! In T176370#3934066, @MoritzMuehlenhoff wrote:
> During the SRE offsite/onsite we came up with the following plan:
>
> * We need to remove PHP 5 usage by May 2018 (branch date for the next Mediawiki LTS)
> ** Only open issue is dumps, which is showing good progress (needs wikidiff build and review of php7 puppet patch)
>
> * We're planning the ICU migration (detailed in T177498) to happen this quarter:
> ** HHVM package for icu57 needs to be upgraded to 3.18.8
> ** Initial testing will happen on mwdebug
> ** Also deployment-prep will be upgraded to the new packages (allows preparation of patches to use more recent Unicode)
> ** For actual migration Community Liaisons need to be involved (user-visible effects)
> ** First all app servers need to be upgraded, the run the conversion script (will take several days)
>
> * Once we have upgraded to HHVM/ICU57 on jessie, we can upgrade to HHVM 3.18/stretch (we should be able to complete that by Q4)
>
> * Once we're on stretch we can upgrade to HHVM 3.24
>
> * We came up with the following migration plan towards PHP 7:
> ** Running php7-fpm on different port
> ** Depending on cookie route to HHVM or php7-fpm for initial testing
> ** Add PHP7 as a beta feature for more widespread exposure
> ** Gradually ramp up the PHP usage towards all users
> ** If all goes fine we should be complete before the fundraising silent period, otherwise after that
> ** Profiling is currently a known blocker – T176916