2014-11-24 15 views
1

我正在使用Google App Engine(GAE)进行网页开发,并且还使用了Smarty html模板引擎。Google App引擎无法打开SMARTY php脚本

这是我在include.php中使用的代码段。在我部署 之后,它向我展示了没有输出并向我显示这些日志。

<?php 
include_once(dirname(dirname(__FILE__)) . '/includes/configs/config.inc.php'); 

if (!isset($_SESSION)) 
    session_start(); 

$_SESSION['timestamp'] = time(); 

if (isset($_SESSION['auth']) && $_SESSION['auth'] === true) 
    $authStatus = true; 

include_once(INCLUDE_DIR . '/library/util.php'); 
include_once(INCLUDE_DIR . '/library/connection.php'); 
include_once(CLASSES_DIR . 'db.class.php'); 
include_once(INCLUDE_DIR . '/langs/en.lang.php'); 
include_once(INCLUDE_DIR . '/helpers/browserDetect.class.php'); 

这将是我登出把

PHP的警告:include_once()的:实际上open_basedir的限制。文件(/ base/data/home/apps/s〜/includes/configs/config.inc.php)不在以下允许的路径中:(/ base/data/home/apps/s〜 /1.380323599570411257 /;/base/data/home/runtimes/php/sdk;/php_runtime/versions;/etc)在/base/data/home/apps/s~**/1.380323599570411257/includes.php上线2

PHP警告:include_once(/ base/data/home/apps/s〜/includes/configs/config.inc.php):无法打开流:/ base/data/home/apps/s中不允许操作〜 /1.380323599570411257/includes.php第2行

这将是我的app.yaml

application: *** 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /css 
    static_dir: css 

- url: /images 
    static_dir: images 

- url: /js 
    static_dir: js 

- url:/
    script: index.php 

- url: /(.+)$ 
    script: index.php 

回答

1

我把我的app.yaml文件的文档根目录之外。 我更新的app.yaml到这样的事情,它为我工作

application: creditcard-deals 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /css 
    static_dir: css 

- url: /images 
    static_dir: images 

- url: /js 
    static_dir: js 

- url: /(.*/)?.*\.tpl 
    mime_type: application/vnd.trid.tpt 
    static_files: tpl 
    upload: static/(.*\.tpl) 

- url: (.+).php 
    script: \1.php 

- url: /.* 
    script: /docroot/index.php 
+1

@SahilMittal当然。 – 2015-01-22 07:49:55

0

你有太多的调用目录名,尝试

<?php 
include_once(dirname(__FILE__) . '/includes/configs/config.inc.php'); 
+0

我试过了,但它仍然显示此日志。 '0 PHP警告:include_once(/base/data/home/apps/s~creditcard-deals/1.380325141954686891/includes/configs/config.inc.php):无法打开流:没有这样的文件或目录在/基地/data/home/apps/s~creditcard-deals/1.380325141954686891/includes.php第2行' – 2014-11-24 09:35:58

+0

我只需要向后翻一个目录。 – 2014-11-24 09:37:48