PHP on GAE using Quercus

306 views
Skip to first unread message

moriyoshi

unread,
Apr 9, 2009, 1:44:46 PM4/9/09
to Google App Engine
Hi,

Probably this is not a news, but I couldn't find a similar attempt so
here goes... I managed to get (patched) Quercus [1] to work on GAE.
This means now you can run considerable number of PHP application.

I'm going to post further details to my blog (http://d.hatena.ne.jp/
moriyoshi/ - mostly in Japanese).

Hope you are interested.
Moriyoshi

[1] http://quercus.caucho.com/

Moriyoshi Koizumi

unread,
Apr 10, 2009, 1:28:37 PM4/10/09
to Google App Engine
Hi,

Finally I pushed my local work to GitHub. See HOWTO to reproduce the attempt.

http://github.com/moriyoshi/quercus-gae/

Enjoy!
Moriyoshi

diablonhn

unread,
Apr 14, 2009, 12:37:53 AM4/14/09
to Google App Engine
Hi moriyoshi,

Awesome work! There are a few modules that are missing from your
com.caucho.quercus.QuercusModule file:

com.caucho.quercus.lib.curl.CurlModule
com.caucho.quercus.lib.date.DateModule
com.caucho.quercus.lib.file.FileModule
com.caucho.quercus.lib.gettext.GettextModule
com.caucho.quercus.lib.json.JsonModule
com.caucho.quercus.lib.i18n.MbstringModule
com.caucho.quercus.lib.mcrypt.McryptModule
com.caucho.quercus.lib.reflection.ReflectionModule
com.caucho.quercus.lib.string.StringModule
com.caucho.quercus.lib.i18n.UnicodeModule
com.caucho.quercus.lib.xml.DomModule
com.caucho.quercus.lib.xml.XmlModule
com.caucho.quercus.lib.xml.XMLWriterModule
com.caucho.quercus.lib.zip.ZipModule
com.caucho.quercus.lib.zlib.ZlibModule
com.caucho.quercus.lib.jms.JMSModule
com.caucho.quercus.lib.pdf.PDFModule
com.caucho.quercus.lib.bam.BamModule

Most of them are essential. Some don't apply in the GAE environment.
Also, I think you should include the
com.caucho.quercus.QuercusClass file. That file lists Java classes
that back the equivalent PHP classes.

On Apr 10, 10:28 am, Moriyoshi Koizumi <m...@mozo.jp> wrote:
> Hi,
>
> Finally I pushed my local work to GitHub. See HOWTO to reproduce the attempt.
>
> http://github.com/moriyoshi/quercus-gae/
>
> Enjoy!
> Moriyoshi
>

Roshan A

unread,
Apr 14, 2009, 8:32:49 AM4/14/09
to Google App Engine
Hi All,

See details on how to Run PHP on Google App Engine using Quercus
http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/
Just download the file in the link and you can run PHP on app engine
in minutes.
Also see http://phpwithjava.appspot.com/webdigi.php

Regards

On Apr 10, 6:28 pm, Moriyoshi Koizumi <m...@mozo.jp> wrote:
> Hi,
>
> Finally I pushed my local work to GitHub. See HOWTO to reproduce the attempt.
>
> http://github.com/moriyoshi/quercus-gae/
>
> Enjoy!
> Moriyoshi
>

Roshan A

unread,
Apr 14, 2009, 12:12:23 PM4/14/09
to Google App Engine
Download the war folder to run PHP on the google app engine from here
http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/

On Apr 10, 6:28 pm, Moriyoshi Koizumi <m...@mozo.jp> wrote:
> Hi,
>
> Finally I pushed my local work to GitHub. See HOWTO to reproduce the attempt.
>
> http://github.com/moriyoshi/quercus-gae/
>
> Enjoy!
> Moriyoshi
>

Moriyoshi Koizumi

unread,
Apr 14, 2009, 9:03:31 PM4/14/09
to google-a...@googlegroups.com
Hi,

Thanks for the heads-up. It seems I forgot to add these modules as
they don't reside right under com/caucho/quercus/lib :)

Moriyoshi

ocb

unread,
Apr 16, 2009, 1:24:16 PM4/16/09
to Google App Engine
Anybody successful using the datastore API directly from PHP with
quercus ?

=> See here for all other good links: http://php-on-gae.appspot.com

On 15 Apr., 03:03, Moriyoshi Koizumi <m...@mozo.jp> wrote:
> Hi,
>
> >> > [1]http://quercus.caucho.com/- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

jbondc

unread,
Apr 16, 2009, 3:09:37 PM4/16/09
to Google App Engine
I tried this code which I think should work.. any ideas? Looks like a
quercus issue.

import com.google.appengine.api.datastore;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.DatastoreServiceFactory;

$data = array('test' => 1,
'test2' => 2);

$entity = new Entity("MV_Storage_Php");
$entity->setProperty("value", serialize($data));

echo "KEY: ". (string)$entity->getKey(); // ok - unknown
echo "VALUE: ". (string)$entity->getProperty("value"); // ok

$dataService = DatastoreServiceFactory::getDatastoreService();

foreach($dataService->getActiveTransactions() as $t) {
echo "TRANS: ". $t->getId(); // no transactions...
}

$dataService->put($entity); // NULL exception?

echo $entity->getKey();

Read this:
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html
> > >> > [1]http://quercus.caucho.com/-Zitierten Text ausblenden -

ocb

unread,
Apr 16, 2009, 5:20:54 PM4/16/09
to Google App Engine
I've got the same error before. Thanks for confirmation.

On 16 Apr., 21:09, jbondc <jbo...@gmail.com> wrote:
> I tried this code which I think should work.. any ideas? Looks like a
> quercus issue.
>
> import com.google.appengine.api.datastore;
> import com.google.appengine.api.datastore.Entity;
> import com.google.appengine.api.datastore.DatastoreServiceFactory;
>
> $data = array('test' => 1,
>          'test2' => 2);
>
> $entity = new Entity("MV_Storage_Php");
> $entity->setProperty("value", serialize($data));
>
> echo "KEY: ". (string)$entity->getKey(); // ok - unknown
> echo "VALUE: ". (string)$entity->getProperty("value"); // ok
>
> $dataService = DatastoreServiceFactory::getDatastoreService();
>
> foreach($dataService->getActiveTransactions() as $t) {
>         echo "TRANS: ". $t->getId(); // no transactions...
>
> }
>
> $dataService->put($entity); // NULL exception?
>
> echo $entity->getKey();
>
> Read this:http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...
> > > >> > [1]http://quercus.caucho.com/-ZitiertenText ausblenden -
>
> > > - Zitierten Text anzeigen -- Zitierten Text ausblenden -
Reply all
Reply to author
Forward
0 new messages