app.yaml cannot call my css file for my index.php

0 views
Skip to first unread message

user2491321 via StackOverflow

unread,
Dec 25, 2014, 1:16:12 PM12/25/14
to google-appengin...@googlegroups.com

I have create an app in php. The folder "myapp-test-1" has a file called index.php and a folder CSS which includes the file main.css which is the css file for index.php .I am trying to create my app yaml file in order to upload my project in google's app engine. This is my app.yaml file:

application: myapp-test-1  
version: 1
runtime: php
api_version: 1

handlers:

- url: /.*
  script: index.php

- url: /css
  static_dir: css

- url: /css/
  script: main.css

when test it in browser it seems that index.php file is not full loaded. Moreover the css for index.php is not working.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27649625/app-yaml-cannot-call-my-css-file-for-my-index-php

Mamba via StackOverflow

unread,
Dec 25, 2014, 1:26:13 PM12/25/14
to google-appengin...@googlegroups.com

I believe that you should try to leave only :
- url: /.*
script: path/index.php

and remove the two references to the css.

from inside the index.php, make sure that you call your css file using the right path. eventually if you use firefox, the function "inspect element" and the console, will tell you why your file is not loaded...

good luck



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27649625/app-yaml-cannot-call-my-css-file-for-my-index-php/27649675#27649675

Pi Joules via StackOverflow

unread,
Dec 25, 2014, 4:31:12 PM12/25/14
to google-appengin...@googlegroups.com

You need to have the

- url: /.*
  script: index.php

last, because if you have it first, the order in which GAE will read this file is this, then the other two css ones. The regex .* next to url says that all URLs will lead to index.php, so putting this last will allow GAE to read the css ones first. You also don't need to include

- url: /css/
  script: main.css

if you're only going to load the css files in your index.php.

So overall, it should look like

application: myapp-test-1  
version: 1
runtime: php
api_version: 1

handlers:

- url: /css
  static_dir: css

- url: /.*
  script: index.php


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27649625/app-yaml-cannot-call-my-css-file-for-my-index-php/27650850#27650850
Reply all
Reply to author
Forward
0 new messages