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...

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

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)