YAML rendering index.html every time any PHP is called on gCloud App Engine
I am learning how to move my existing PHP project to gCloud.
For the same, I created an AppEngine project and have placed my code there.
Everything seems to work except the PHP files.
When I launch my project, the index files launches (as specified in app.yaml) and then where the PHP should execute, it's renders the index.html file. This creates a deadly loop of index calling PHP calling index calling PHP :(
I am sure I have my app.yaml wrong, but am unable to figure out where the problem is.
My yaml looks like this:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
- url: /dialpad_research/static
static_dir: dialpad_research/static
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/1
upload: static/(.*.(bmp|gif|ico|jpeg|jpg|png))
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
- url: /dialpad_research/api/(.+.php)$
script: api/1
Any help is appreciated.
Folder structure is like this:
Root
|
---- app.yaml
---- dialpad_research (folder)
|
---- static (folder with index file)
---- api (folder with PHP files)
php google-app-engine google-cloud-platform yaml
add a comment |
I am learning how to move my existing PHP project to gCloud.
For the same, I created an AppEngine project and have placed my code there.
Everything seems to work except the PHP files.
When I launch my project, the index files launches (as specified in app.yaml) and then where the PHP should execute, it's renders the index.html file. This creates a deadly loop of index calling PHP calling index calling PHP :(
I am sure I have my app.yaml wrong, but am unable to figure out where the problem is.
My yaml looks like this:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
- url: /dialpad_research/static
static_dir: dialpad_research/static
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/1
upload: static/(.*.(bmp|gif|ico|jpeg|jpg|png))
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
- url: /dialpad_research/api/(.+.php)$
script: api/1
Any help is appreciated.
Folder structure is like this:
Root
|
---- app.yaml
---- dialpad_research (folder)
|
---- static (folder with index file)
---- api (folder with PHP files)
php google-app-engine google-cloud-platform yaml
add a comment |
I am learning how to move my existing PHP project to gCloud.
For the same, I created an AppEngine project and have placed my code there.
Everything seems to work except the PHP files.
When I launch my project, the index files launches (as specified in app.yaml) and then where the PHP should execute, it's renders the index.html file. This creates a deadly loop of index calling PHP calling index calling PHP :(
I am sure I have my app.yaml wrong, but am unable to figure out where the problem is.
My yaml looks like this:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
- url: /dialpad_research/static
static_dir: dialpad_research/static
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/1
upload: static/(.*.(bmp|gif|ico|jpeg|jpg|png))
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
- url: /dialpad_research/api/(.+.php)$
script: api/1
Any help is appreciated.
Folder structure is like this:
Root
|
---- app.yaml
---- dialpad_research (folder)
|
---- static (folder with index file)
---- api (folder with PHP files)
php google-app-engine google-cloud-platform yaml
I am learning how to move my existing PHP project to gCloud.
For the same, I created an AppEngine project and have placed my code there.
Everything seems to work except the PHP files.
When I launch my project, the index files launches (as specified in app.yaml) and then where the PHP should execute, it's renders the index.html file. This creates a deadly loop of index calling PHP calling index calling PHP :(
I am sure I have my app.yaml wrong, but am unable to figure out where the problem is.
My yaml looks like this:
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
- url: /dialpad_research/static
static_dir: dialpad_research/static
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/1
upload: static/(.*.(bmp|gif|ico|jpeg|jpg|png))
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
- url: /dialpad_research/api/(.+.php)$
script: api/1
Any help is appreciated.
Folder structure is like this:
Root
|
---- app.yaml
---- dialpad_research (folder)
|
---- static (folder with index file)
---- api (folder with PHP files)
php google-app-engine google-cloud-platform yaml
php google-app-engine google-cloud-platform yaml
asked Nov 14 '18 at 22:05
ssdesignssdesign
1,11062241
1,11062241
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/
and /static/
are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+.php)$
script: dialpad_research/api/1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error./static/
is not at the root, soupload: static/(...)
will not be found. Updating answer
– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309427%2fyaml-rendering-index-html-every-time-any-php-is-called-on-gcloud-app-engine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/
and /static/
are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+.php)$
script: dialpad_research/api/1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error./static/
is not at the root, soupload: static/(...)
will not be found. Updating answer
– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
add a comment |
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/
and /static/
are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+.php)$
script: dialpad_research/api/1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error./static/
is not at the root, soupload: static/(...)
will not be found. Updating answer
– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
add a comment |
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/
and /static/
are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+.php)$
script: dialpad_research/api/1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
You have to be careful with your regex matching. This url pattern:
- url: /dialpad_research/static
will match:
- url: /dialpad_research/static(anything to follow)
So, it will never get to the handler below:
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
Same for:
- url: /dialpad_research.*
After that, it can never get to:
- url: /dialpad_research/api/(.+.php)$
Reorder your handlers so that they don't short-circuit.
Next, /api/
and /static/
are not at the root so your paths to them are incorrect. See below:
handlers:
- url: /dialpad_research/(.*.(appcache|manifest))
mime_type: text/cache-manifest
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(appcache|manifest))
# image files
- url: /dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
static_files: dialpad_research/static/1
upload: dialpad_research/static/(.*.(bmp|gif|ico|jpeg|jpg|png))
- url: /dialpad_research/api/(.+.php)$
script: dialpad_research/api/1
- url: /dialpad_research/static
static_dir: dialpad_research/static
# dialpad root
- url: /dialpad_research.*
static_files: dialpad_research/static/index.html
upload: dialpad_research/static/index.html
edited Nov 15 '18 at 17:58
answered Nov 14 '18 at 23:00
GAEfanGAEfan
6,8522824
6,8522824
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error./static/
is not at the root, soupload: static/(...)
will not be found. Updating answer
– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
add a comment |
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error./static/
is not at the root, soupload: static/(...)
will not be found. Updating answer
– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
Thanks. When I do these changes, now none of my images are showing up. The path shown in the browser inspector is correct, but it says 404 file not found for all images.
– ssdesign
Nov 15 '18 at 0:03
OK, so I see your 2nd error.
/static/
is not at the root, so upload: static/(...)
will not be found. Updating answer– GAEfan
Nov 15 '18 at 17:56
OK, so I see your 2nd error.
/static/
is not at the root, so upload: static/(...)
will not be found. Updating answer– GAEfan
Nov 15 '18 at 17:56
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
btw. can someone tell me why they marked down my question negative?????
– ssdesign
Nov 16 '18 at 6:30
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309427%2fyaml-rendering-index-html-every-time-any-php-is-called-on-gcloud-app-engine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown