Php Luracast Restler不在谷歌应用程序启动器上工作

Php Luracast Restler不在谷歌应用程序启动器上工作,php,google-app-engine,restler,Php,Google App Engine,Restler,我想在Google Cloud(基于Google App Engine GAE的Joomla和Restler RESTful API服务器)上创建一个包含以下子域的网站: 混合应用程序的http://api.restlerongooglecloud.com(基于为Android、iOS、Windows Phone等智能手机提供服务的Restler api) 及 博客:http://joomla.restlerongooglecloud.com(GAE Launcher上的joomla博客工作得很

我想在Google Cloud(基于Google App Engine GAE的Joomla和Restler RESTful API服务器)上创建一个包含以下子域的网站:

混合应用程序的http://api.restlerongooglecloud.com(基于为Android、iOS、Windows Phone等智能手机提供服务的Restler api)

博客:http://joomla.restlerongooglecloud.com(GAE Launcher上的joomla博客工作得很好,我在这个链接上遵循了指南:http://forum.joomla.org/viewtock.php?f=706&t=828565&p=3114492)

主页http://www.restlerongooglecloud.com

在我将现场站点上传到GAE Cloud之前,我试着测试Restler是否与Google应用程序启动器配合良好

目录结构是

GAEproject root/api/。。。对于Restler 3.0 RC3

GAEproject root/joomla/for blog

GAEproject root/app.yaml

我的app.yaml如下所示:

application: restlerongae
version: 1

runtime: php

api_version: 1



handlers:
## api images
- url: /api/(.*\.(ico$|jpg$|png$|gif$))
  static_files: api/\1
  upload: api/(.*\.(ico$|jpg$|png$|gif$))
  application_readable: true

## api html
- url: /api/(.*\.(htm$|html$|css$|js$))
  static_files: api/\1
  upload: api/(.*\.(htm$|html$|css$|js$))
  application_readable: true

## api test1
- url: /api/(.*)
  script: api/public/examples/_001_helloworld/index.php
当我运行网站并指向Restler 3.0 RC5示例时:

http://localhost/api/public/examples/\u 001\u helloworld/say/hello 我发现以下错误:

{ "error": { "code": 404, "message": "Not Found" }, "debug": { "source": "Routes.php:359 at route         stage", "stages": { "success": [ "get" ], "failure": [ "route", "negotiate", "message" ] } } }
我试图找出这个错误的原因,但不幸的是,我没有成功,而且对面向对象的PHP和Restler还不熟悉

请帮助,我如何修复此错误

由于GAE不使用“.htaccess”文件或Apache,如何使用“mod_rewrite.php”对“Aapache mod_rewrite特性”进行建模请参见此处的更多详细信息:https://developers.google.com/appengine/docs/php/config/mod_rewrite

进一步:

由于应用程序的分布式特性,App Engine不支持写入本地文件。相反,必须持久化的数据应该存储在分布式数据存储中。有关更多信息,请参阅运行时沙盒上的文档

应用程序引擎应用程序无法:

写入文件系统。应用程序必须使用App Engine数据存储来存储持久数据。允许从文件系统读取,并且随应用程序上载的所有应用程序文件都可用

打开套接字或直接访问另一台主机。应用程序可以使用App Engine URL获取服务分别向端口80和443上的其他主机发出HTTP和HTTPS请求

生成子进程或线程。对应用程序的web请求必须在几秒钟内在单个进程中处理。需要很长时间才能响应的进程将被终止,以避免web服务器过载

进行其他类型的系统调用

GAE为Google云存储提供了一个流包装器,这使得使用该服务非常简单。假设您已经完成了GCS上的先决条件,则可以使用标准PHP文件处理函数访问GCS上的文件,如文档所示。
$contents = file_get_contents($file);
var_dump($contents); // prints: hello world
?>

我认为HumanReadableCache.php中的代码需要更改为使用gs://bucket/file实现缓存。(apiVersionMap自动生成文件)我不是一个真正的OOP_PHP程序员,无法替换/编辑HumanReadableCache.PHP中的代码,所以请您提供帮助,并提出Restler的GAE版本?非常感谢。

您是否可以尝试使用RC6,它修改了HumanReadableCache版本,不检查文件的可写性

$contents = file_get_contents($file);
var_dump($contents); // prints: hello world
?>
在index.php中,执行以下操作以映射数据的保存路径

use Luracast\Restler\Restler;
use Luracast\Restler\HumanReadableCache;

HumanReadableCache::$cacheDir = 'gs://bucket'; //replace bucket with your bucket name

$r = new Restler();
//...

即使添加$cacheDir='gs://bucket';我得到以下错误:{“error”:{“code”:404,“message”:“Not Found”},“debug”:{“source”:“Routes.php:359 at route stage”,“stages”:{“success”:[“get”],“failure”:[“route”,“negotiate”,“message”]}},这意味着它找不到给定url的有效路由。请尝试一个已知且有效(else-where)的示例,其中包含确切的url和参数