PHP - Google App Engine app.yaml "has custom peformance settings" - php

I am trying to upload this as my app.yaml
application: *******
version: 2
runtime: php55
api_version: 1
threadsafe: yes
instance_class: F2
automatic_scaling:
min_idle_instances: 1
max_idle_instances: 5
min_pending_latency: 5.0s
max_pending_latency: 7.7s
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /resources
static_dir: resources
- url: /static
static_dir: static
- url: /test.php
script: test.php
- url: .*
script: home/service/index.php
How ever every time I do upload it, it says I am using custom peformance settings and to look at the application section. This is the exact error I get Your application currently has custom performance settings that are not compatible with the Modules feature. You must either clear or migrate these application-level settings before you can upload a non-default module. See the Performance section of the Application Settings page of the Admin Console for more information.
So I looked at the migrate to app section and here is what it says.
application: ********
# Other settings here...
instance_class: F2
automatic_scaling:
min_idle_instances: 1
max_idle_instances: 5
min_pending_latency: 5.0s
max_pending_latency: 7.7s
I've followed the guides as close as possible, I am not sure what is wrong with my app.yaml? I have removed all the other .yaml files (I had a pdf.yaml [module] and a dispatch.yaml) it all booted up fine on the local dev machine but when I call appcfg.py update app.yaml - I just get told of my issue with custom performance settings, any help would be much appreciated

It's funny every time I post to Stackoverflow, I always find a solution soon after (I've been trying to solve this issue for days btw)
You have to set all the application settings to Automatic on the Old-Settings page, and suddenly modules work.
Cheers

Related

Google App Engine problem. URL grouping not working

My app was working fine in php55 using the below app.yaml settings to grouped URLs. E.G. /api/manage, /api/edit, api/user/add should all be forwarded to /api/api.php but stopped working when upgraded to php72.
Fine below the app.yaml conifig for both php55 and php72 for your help.
Configuration for php55
service: default
runtime: php55
handlers:
- url: /api((/$)|(/[^/]+(/$)?)*)
script: /api/api.php
secure: always
Configuration for php72
service: default
runtime: php72
handlers:
- url: /api/(.*?)/(.*)
script: /api/api.php
secure: always
Thanks in advance.
For the 2nd generation runtimes (including PHP 7+) you no longer use the script element to route traffic (documentation). You have to use a language idiomatic web/routing framework (e.g. Flask in Python, a front controller for PHP).

How to create or deploy another service/module (have deployed on default) on GAE [Google App engine] PHP

I have already deployed on Google App Engine default service in PHP, but I need to create another service to enable me redirect to the mobile version of my website from example.com to mobile.example.com.
I read on google docs that you use I AM ADMIN, I have done the suggested method but to no avail.
Please kindly point me to the way. Thanks in advance.
I just figured it out. The solution was in the app.yaml file, add the service:service_name in the app.yaml if it is not created, it would create it automatically.
runtime: php72
runtime_config:
document_root:
handlers:
- url: /.*
script: auto
secure: always
redirect_http_response_code: 301
entrypoint:
serve worker.php
TO
runtime: php72
runtime_config:
document_root:
handlers:
- url: /.*
script: auto
secure: always
redirect_http_response_code: 301
entrypoint:
serve worker.php
service: mobile-frontend

Expiration in handlers in app.yaml for google app engine and laravel are not working

I use google app engine to serve my laravel application and would like to set the expiration time of my javascript and css files located in the public folder in laravel.
Response header of js and css files:
cache-control: max-age=600, public
Which is the default of google app engine.
But in my app.yaml I set the following:
runtime: php
env: flex
runtime_config:
document_root: public
skip_files:
- .env
# I tried to set this to see if the error is in my handlers, but it was
# still the default 10mins
default_expiration: "30d"
handlers:
- url: /js/.*
static_dir: public/js
expiration: "30d"
- url: /css/.*
static_dir: public/css
expiration: "30d"
Somehow I can't overwrite the defaults of google and I dont know any further to be honest.
I already disabled the session.cache_limiter in php.ini, like it was suggested here Laravel response Cache-Control headers always containing 'no-cache'
Still no difference.
You are using AppEngine flexible environment: env: flex which does not support default_expiration and expiration, try using standard environment.

Google App Engine - Separate Project Required?

I'm trying to port a simple website across to the Google App Engine. My website uses PHP and accesses a MySQL database.
In the App engine I've created a project, e.g.: my-project.
Then within that project I did what I was told, to get a MySQL database up and running: create a SQL instance, download phpMyAdmin locally, create app.yaml file:
application: my-project
version: 1
module: default
runtime: php55
api_version: 1
handlers:
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: \1
upload: (.*\.(ico$|jpg$|png$|gif$))
application_readable: true
- url: /(.*\.(htm$|html$|css$|js$))
static_files: \1
upload: (.*\.(htm$|html$|css$|js$))
application_readable: true
- url: /(.*\.(php$))
script: \1
login: admin
- url: /(.+)
script: index.php
login: admin
- url: /.*
script: index.php
login: admin
I then deployed the app and went to
https://phpmyadmin-dot-my-project.appspot.com
phpMyAdmin worked perfectly.
Next, I created followed the helloworld.php example:
https://cloud.google.com/appengine/docs/php/gettingstarted/helloworld
Again, that worked, with the PHP code executing on the server to display 'Hello world!'.
Finally, I went back to:
https://phpmyadmin-dot-my-project.appspot.com
but no dice, it just displays 'Hello world!'.
Must be something very basic that I'm missing, do I need to create a separate project for each?
E.g.:
1. create project with MySQL DB instance and phpMyAdmin
2. create project with the PHP files
In the app.yaml for phpmyadmin, I needed to change:
module: default to module: phpmyadmin
application: myapp-beta
version: 1
module: phpmyadmin
runtime: php55
api_version: 1
Same for the app.yaml file for helloworld. Just created a new module called helloworld.
Need to read up on YAML and modules... thanks!

Error 400 : PHP 5.4 applications are prevented from being deployed to Google App Engine

This is my app.yaml file:
application: xxxxxxxxxxxxx
version: 1
runtime: php55
api_version: 1
threadsafe: true
handlers:
- url: /images
static_dir: images
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /libraries
static_dir: libraries
- url: /
script: main.php
# Serve php scripts.
- url: /(.+\.php)$
script: \1
This is the error I get:
Error 400: --- begin server output ---
PHP 5.4 applications are prevented from being deployed to Google App Engine from any version of the SDK, including older ones. If you need to continue to deploy PHP 5.4 applications for compatibility reasons, you can request that your application be whitelisted for PHP 5.4 deployment by visiting http://goo.gl/qjKEuk.
--- end server output ---
Can somebody please tell me why I still get this error after changing runtime from php to php55 in app.yaml?
You need to update your Google App Engine Launcher to 1.9.18 or higher. You can't use php55 with 1.9.17 (and I just updated to 1.9.20 and it is a bit different, uses your browser to log in).
PhpStorm plugin is still not compatible with deploying php55 apps. Deploying through Google App Engine Launcher works fine.

Categories