Home > Article > Backend Development > How to use smarty template in sae_PHP tutorial
Smarty is a very popular template system. It separates business and logic, has fast execution speed, and is widely used in PHP websites.
However, there was a problem when deploying to sina app engine (sae). Because sae, as a cloud computing platform, cannot perform file reading and writing operations, the cache files output in Smarty cannot be realized.
Error message: "SAE_Fatal_error: Uncaught exception 'SmartyException' with message 'unable to write file ./web/templates_c/wrt4e95555280ef1' "
SAE’s solution is to use Memcache. First enter the application management in the application and enable Memcache initialization in the service management,
Then modify Smarty’s configuration file:
The above three lines are required.
This way the Smarty template can run on SAE.