PHP Version Upgrade Breaks Application

Problem

Application started to prompt error "Page Not Found" after PHP server was upgraded.

 

Diagnostics

1. Checking if PHP version is fully installed and functional:

server webroot # php -v
PHP 7.1.0 (cli) (built: Jan 20 2017 17:37:04) ( NTS ) <==== OK
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.1.0, Copyright (c) 1999-2016, by Zend Technologies

 

2. Checking if PHP application is operational:

server webroot # php -S localhost:1234  <== Testing folder access (OK)
PHP 7.1.0 Development Server started at Wed Mar 28 05:22:47 2018
Listening on http://localhost:1234 
Document root is /data/studentportal/releases/20180326182319/webroot
[Wed Mar 28 05:23:00 2018] ::1:39490 [301]: /
[Wed Mar 28 05:23:04 2018] ::1:39498 [302]: /portal
[Wed Mar 28 05:23:09 2018] ::1:39510 [404]: /portal/courses
######

server webroot # curl localhost:1234/ -I   <== Testing application root (OK)
HTTP/1.1 301 Moved Permanently
Host: localhost:1234
Date: Wed, 28 Mar 2018 05:23:00 +0000
Connection: close
Set-Cookie: domain_portal=c10b3961b93104584ca5f6d7c6f1ecff; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
Location: http://staging-my.domain.com/portal/courses

server webroot # curl localhost:1234/portal/courses -I <== Testing application subfolder (Error:Page not Found)
HTTP/1.1 404 Not Found
Host: localhost:1234
Date: Wed, 28 Mar 2018 05:23:09 +0000
Connection: close
Content-Type: text/html; charset=UTF-8

3. Checking SYSLOG from PHP installation: it reports PHP-FPM cannot start, pointing to a mismatch between extension newrelic and the new PHP version.

Mar 28 18:20:03 localhost monit[4583]: 'php-fpm' process is not running 
Mar 28 18:20:03 localhost monit[4583]: 'php-fpm' trying to restart 
Mar 28 18:20:03 localhost monit[4583]: 'php-fpm' start: /bin/bash 
Mar 28 18:20:31 localhost collectd[26660]: exec plugin: Program `/engineyard/bin/check_health_for' has closed STDERR. 
Mar 28 18:20:33 localhost monit[4583]: 'php-fpm' failed to start (exit status 1) -- /bin/bash: [28-Mar-2018 18:20:03] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php7.1/lib/extensions/no-debug-non-zts-20160303/newrelic.so' - /usr/lib64/php7.1/lib/extensions/no-debug-non-zts-20160303/newrelic 

 

Solution

There is an additional step to be made in order to complete PHP 7.1 installation and synchronize the required libraries on the server:

1. Manually issue a "chef run" to redeploy master application.