douhan1992 2013-10-31 21:07 采纳率: 100%
浏览 57
已采纳

PHP Google App Engine YAML找不到目录

My App Engine isn't loading my css, javascripts, or images. My index.php and login.php are the only files that I've been able to find so far however my other files use sessions to prevent unauthorized access so I'm not sure I'll be able to get to them without logging in first.

Directory Structure is from the app.yaml file to the corresponding files.

I'm using Google's App Engine with PHP and my YAML code is below

handlers:
- url: /index.php
  script: content/home/index.php

- url: /login.php
  script: content/home/login.php

- url: /control.php
  script: content/home/control.php

- url: /admin.php
  script: content/home/admin.php

- url: /logout.php
  script: content/home/logout.php

- url: /checkaccess.php
  script: content/home/checkaccess.php

- url: /register.php
  script: content/home/register.php

- url: /managemodule.php
  script: content/home/managemodule.php

- url: /manageuser.php
  script: content/home/manageuser.php

- url: /update.php
  script: content/home/update.php

- url: /.*
  script: content/home/index.php

- url: /images
  script: images

- url: /stylesheets
  static_dir: system/templates/stylesheets

- url: /includes
  script: system/templates/includes

- url: /scripts
  script: system/templates/javascript

I tried to use static_dir: as well as script: for the stylesheets, javascript, and images. The includes oddly enough works fine with no issues but I cannot get my images, css, or scripts to work correctly.

I tried to inspect the files and they're not found but I know they've uploaded via appcfg.py. In my logs it states "No handlers matched this URL."

If anyone has a great readme or any other information regarding YAML I'd greatly appreciate it. I've read the YAML description from Google a few times and checked the YAML website I feel like I'm doing it right. I tried with another project (a lot simpler) and it worked with no issues.

  • 写回答

1条回答 默认 最新

  • douyuepi6485 2013-10-31 22:27
    关注
    handlers:
    - url: /index.php
      script: index.php
    
    - url: /login.php
      script: login.php
    
    - url: /control.php
      script: control.php
    
    - url: /admin.php
      script: admin.php
    
    - url: /logout.php
      script: logout.php
    
    - url: /checkaccess.php
      script: checkaccess.php
    
    - url: /register.php
      script: register.php
    
    - url: /managemodule.php
      script: managemodule.php
    
    - url: /manageuser.php
      script: manageuser.php
    
    - url: /update.php
      script: update.php
    
    - url: /images
      static_dir: images
    
    - url: /stylesheets
      static_dir: stylesheets
    
    - url: /includes
      script: system/templates/includes
    
    - url: /scripts
      static_dir: scripts
    

    Ended up working but I wouldn't be surprised if I have more errors still. Just put this up in case someone else stumbles upon this. What was wrong was the /.* that I had above. I removed that and put the static_dir and it worked...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序