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 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化