Yii Framework Forum: Installing Yii on Google Application Engine (Java) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Installing Yii on Google Application Engine (Java) Rate Topic: -----

#1 User is offline   voorwater 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 02-September 11

Posted 02 September 2011 - 09:54 AM

I've just started experimenting with Yii on GAE using Quercus as PHP emulator and Jiql as MySQL emulator.
The basic php/MySQL applications seems to be running with no problems.
Initial Yii requirement test shows that the setup passed basic checks. (See the link: yii-on-gae.appspot.com )
Well, I had to remove almost all i18n files to trim the framework since Google allows only 1000 files per application and I also run jiql administrator ( yii-on-gae.appspot.com/Jiqladmin.html ) to handle access to the DataStore's BigTable which has 200 files of its own.
The problem with Yii demo application is the same as discussed in a parallel topic: server can not write to /protected/runtime directory. I do not know how Quercus Apache handle permissions (will check with there team asap).
The question: is it possible to change the location of /runtime folder?
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 02 September 2011 - 10:29 AM

 voorwater, on 02 September 2011 - 09:54 AM, said:

The question: is it possible to change the location of /runtime folder?


This allowed me to get the application skeleton running in a restricted hosting environment, but may ot may not be a good place for the applications runtime files

protected/config/main.php
return array(
  ...
  'runtimePath'=>'/tmp/runtime/',
  ...
);

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#3 User is offline   voorwater 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 02-September 11

Posted 02 September 2011 - 11:29 AM

 tri, on 02 September 2011 - 10:29 AM, said:

protected/config/main.php
return array(
  ...
  'runtimePath'=>'/tmp/runtime/',
  ...
);



Still not writable.

Application runtime path "/tmp/runtime/" is not valid. Please make sure it is a directory writable by the Web server process.

PS I found why:

"Writing to local files is not supported in App Engine due to the distributed nature of your application. Instead, data which must be persisted should be stored in the distributed datastore.

The Sandbox

To allow App Engine to distribute requests for applications across multiple web servers, and to prevent one application from interfering with another, the application runs in a restricted "sandbox" environment. In this environment, the application can execute code, store and query data in the App Engine datastore, use the App Engine mail, URL fetch and users services, and examine the user's web request and prepare the response.
An App Engine application cannot:
write to the filesystem. Applications must use the App Engine datastore for storing persistent data. Reading from the filesystem is allowed, and all application files uploaded with the application are available."

Looks like "this is it". :(

This post has been edited by voorwater: 02 September 2011 - 11:47 AM

0

#4 User is offline   voorwater 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 02-September 11

Posted 02 September 2011 - 12:27 PM

A purely theoretical follow up question.
Is it at all possible to configure an Yii application to write everything - any session and cache information
- to a database (e.g. using 'CDbCache' and 'CDbHttpSession') and do not use /runtime folder at all?

(Follow up)
The answer is yes. With the help of 'CDbCache' 'CDbHttpSession' and 'CDbLogRoute' it is possible to configure a Yii application to run on 100% read-only file system.
Unfortunately, with respect to running it on GAE this does not solve all problems.
The Quercus does not support full PHP PDO functionality, specifically PDO::getAttribute.
So the attempt to run Yii on GAE failed completely. :(

This post has been edited by voorwater: 03 September 2011 - 06:25 PM

0

#5 User is offline   itpg 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 01-April 11

Posted 30 October 2011 - 01:25 AM

 voorwater, on 02 September 2011 - 09:54 AM, said:

server can not write to /protected/runtime directory.


Writing to local files is not supported in App Engine due to the distributed nature of your application.
http://code.google.c....html#writefile
0

#6 User is offline   cyberpunk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-September 13

Posted 10 October 2013 - 12:27 PM

Search for yii-app-engine project on github.com, it's a Yii application skeleton which you can clone and upload to Google App Engine.

but before uploading you will need to create a Google Cloud Storage bucket and modify main.php file, so your assets can be saved into proper place.
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users