Home > Backend Development > PHP Tutorial > Smarty For SAE (using smarty in sae)_PHP tutorial

Smarty For SAE (using smarty in sae)_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:50:44
Original
843 people have browsed it

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 implemented.
Error message: "SAE_Fatal_error: Uncaught exception 'SmartyException' with message 'unable to write file ./web/templates_c/wrt4e95555280ef1' "
The solution given by SAE 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:

//For SAE compiled files are stored in memcache
$smarty->compile_dir = 'saemc://smartytpl/';
$smarty->cache_dir = 'saemc://smartytpl/';
$smarty->compile_locking = false; // Prevent calling touch, saemc will automatically update the time, no touch is required
The above three lines are required.
In this way, the Smarty template can be run on SAE.

Excerpted from 〃Style ひぐ

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478240.htmlTechArticleSmarty is a very popular template system. It separates business and logic and has fast execution speed. It has Widely used. However, there was a problem when deploying to sina app engine (sae)...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
smarty turns on caching garbled characters
From 1970-01-01 08:00:00
0
0
0
Why does tp use smarty template? ?
From 1970-01-01 08:00:00
0
0
0
How do you use smarty to integrate laravel5?
From 1970-01-01 08:00:00
0
0
0
Two ways to install smarty
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template