WPEngine Fatal Error related to config/view path in Sage 9

I’m experiencing a fatal error on a WP Engine install that was running smoothly yesterday and rolling back to backups versions isn’t helping. The error appears to be related to this topic . This is not my build, but the previous dev changed config/view View Path to 'compiled' => '/tmp/sage-cache', and now in the root wordpress install live a tmp folder with sage-cache folder inside. However, that folder is empty on all versions we’ve tried rolling back to, but we have a Fatal Error based on line 74 of a cache file that doesn’t exist there? I’m quite confused by this. Here is the full error. Any ideas?

Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected ‘>’ in /tmp/sage-cache/a09b50b926e00efdf4e9f3807b4266863c477d07.php:74 Stack trace: #0 /nas/content/live/dieselpro/wp-content/themes/dieselpro/vendor/illuminate/view/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath(’/tmp/sage-cache…’, Array) #1 /nas/content/live/dieselpro/wp-content/themes/dieselpro/vendor/illuminate/view/View.php(142): Illuminate\View\Engines\CompilerEngine->get(’/nas/content/li…’, Array) #2 /nas/content/live/dieselpro/wp-content/themes/dieselpro/vendor/illuminate/view/View.php(125): Illuminate\View\View->getContents() #3 /nas/content/live/dieselpro/wp-content/themes/dieselpro/vendor/illuminate/view/View.php(90): Illuminate\View\View->renderContents() #4 /tmp/sage-cache/64885fdf2d5616398077c6e0af6c16e8931b6a96.php(19): Illuminate\View\View->render() #5 /nas/content/live/dieselpro/wp-content/themes/dieselpro/vendor/illuminate/view/Engines/PhpEngine.php(43): include(’/tmp in /tmp/sage-cache/a09b50b926e00efdf4e9f3807b4266863c477d07.php on line 74

Hey Colin,

Have you reached out to WP Engine support about this issue yet? If so, can you provide any more insight?

Thanks Ben. My project manager is on hold with them now actually, will update with what they say.

Sorry for such a delayed update, this remained broken most of yesterday and WP Engine were of no help. Heard from my PM today that he fixed this by swapping out any code that used @php @endphp to plain <?php ?>. He said he figured it out purely by trial and error, it didn’t sound like there was anything that pointed him to that.

The theme had not been updated in quite some time, so this remains a mystery. But maybe if anyone else comes across a similar error on WP Engine using the tmp/sage-cache method linked above, this could be a good place to start.