Sage 9 + WPEngine

Date Created
Nov 11, 2021 01:30 AM
Tags
PHP
Development
WordPress
Date Published
Jul 21, 2020
Published
Published
While working on a site recently, I dove headfirst into Sage 9. It was an amazing experience that I’ll document later. One trivial note I wanted to enforce in the land of Google and searching for common problems is the fix I found when deploying Sage 9 to WPEngine.
Thanks to the user pi_mont on the Sage 9 forum there is a fairly simple fix that will get your Sage 9 theme working in no time.
The trick is to swap ‘compiled’ => wp_upload_dir()[‘basedir’].’/cache’, to ‘compiled’ => ‘/tmp/sage-cache’, like so:

./config/view.php

/* |---------------------------------------------------------------------- | Compiled View Path |---------------------------------------------------------------------- | | This option determines where all the compiled Blade templates will be | stored for your application. Typically, this is within the uploads | directory. However, as usual, you are free to change this value. | */ 'compiled' => '/tmp/sage-cache', // 'compiled' => wp_upload_dir()['basedir'].'/cache',