Re: [google-appengine] Google App Engine php and SMARTY

189 views
Skip to first unread message
Message has been deleted

Barry Hunter

unread,
Nov 26, 2014, 10:48:01 AM11/26/14
to google-appengine
Well by default Smarty writes the compiled templates to the file system, (in the templates_c) folder. 


But on appengine, the filesystem is read only. So smarty won't be able write to the compiled versions. 


You will have to redirect smarty to write the compiled templates (and cached version if use caching!) to somewhere else. 

I know there are plugins for putting the cached files in memcache, bit not sure about the compiled dir. Because it must work by include, it really is expecting filesystem. 


havnt tried it, but it should be possible to use Google Storage for your compiled template directory






On 25 November 2014 at 10:39, <d...@creditcarddeals.lk> wrote:
03:54 PM Application: **-deals; version: 1
03:54 PM Host: appengine.google.com
03:54 PM
Starting update of app: **-deals, version: 1
03:54 PM Getting current resource limits.
Email: dev@**.lk
Password for dev@**.lk:
03:55 PM Scanning files on local disk.
2014-11-25 15:55:11,224 ERROR appcfg.py:1912 Invalid character in filename: includes/smarty/templates_c/%%45^45E^45E480CD%%index.tpl.php
03:55 PM Scanned 500 files.
03:55 PM Scanned 1000 files.
03:55 PM Scanned 1500 files.
03:55 PM Cloning 1681 application files.
03:55 PM Compilation starting.
03:55 PM Compilation completed.
03:55 PM Starting deployment.
03:55 PM Checking if deployment succeeded.
03:55 PM Deployment successful.
03:55 PM Checking if updated app version is serving.
03:55 PM Completed update of app: **-deals, version: 1


This would be my ERROR:

PHP Warning: include(/base/data/home/apps/s~**-deals/1.380349057364915830/includes/smarty/templates_c/%%45^45E^45E480CD%%index.tpl.php): failed to open stream: No such file or directory in /base/data/home/apps/s~**-deals/1.380349057364915830/includes/smarty/libs/Smarty.class.php on line 1254
    W 15:47:53.476
PHP Warning: include(): Failed opening '/base/data/home/apps/s~**-deals/1.380349057364915830/includes/smarty/templates_c/%%45^45E^45E480CD%%index.tpl.php' for inclusion (include_path='.;/base/data/home/apps/s~**-deals/1.380349057364915830/;/base/data/home/runtimes/php/sdk') in /base/data/home/apps/s~**-deals/1.380349057364915830/includes/smarty/libs/Smarty.class.php on line 1254
    I 15:47:53.479
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

I'm new to google app engine and SMARTY and I have no idea what to do.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Vinny P

unread,
Nov 28, 2014, 1:40:32 AM11/28/14
to google-a...@googlegroups.com
On Wed, Nov 26, 2014 at 9:47 AM, Barry Hunter <barryb...@gmail.com> wrote:
You will have to redirect smarty to write the compiled templates (and cached version if use caching!) to somewhere else. 

I know there are plugins for putting the cached files in memcache, bit not sure about the compiled dir. Because it must work by include, it really is expecting filesystem. 



Looking over the smarty documentation, it looks like the template directory can be set by calling setCompileDir: http://www.smarty.net/docs/en/api.set.compile.dir.tpl . Try setting the compile directory to your Cloud Storage bucket using this path: gs://your_cloud_storage_bucket_name/folder_name 

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Reply all
Reply to author
Forward
0 new messages