Git Product home page Git Product logo

getting-started-php's Introduction

getting-started-php's People

Contributors

bshaffer avatar grayside avatar justinbeckwith avatar kweinmeister avatar msampathkumar avatar renovate-bot avatar surferjeffatgoogle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

getting-started-php's Issues

Vendor Folder Missing

I'm following the bookshelf app example on GCP docs in PHP.

Under the getting-started-php/2-structured-data/web/index.php requires files from vendor folder which doesn't exists.

Invalid VM Runtime Specified

I keep getting this error when I try to upload the code to the app engine:

me@big-bite: 1-hello-world$ appcfg.py -A my-hello-world -V v1 update ./
10:17 AM Application: my-hello-world (was: None); version: v1 (was: None)
10:17 AM Host: appengine.google.com
10:17 AM Starting update of app: pete-olsen-hello-world, version: v1
10:17 AM Getting current resource limits.
10:17 AM Scanning files on local disk.
Error 400: --- begin server output ---
Invalid VM runtime specified: php
--- end server output ---

[6-pubsub] The health check handler is slow

The health check handler for the pubsub worker is slow to respond and thus the health check often fails with the default health check configuration (timeout=4secs).

I presume this is because the application initializes the connection to Cloud SQL at startup and also issue an SQL query for creating the table.

Chapter 6-Pubsub

I am getting the following error, even though my document_root has already been set. See Screenshot below.

screen shot 2018-01-04 at 12 52 42 pm

My app.yaml file
screen shot 2018-01-04 at 12 52 57 pm

PHPstorm cant resolve objects

In several files (mostly controllers.php), the PHPdoc annotations need a leading backslash in order to let PHPstorm resolve the classes. For example:

/** @var Twig_Environment $twig */
/** @var Symfony\Component\HttpFoundation\Session\Session $session */

whould become

/** @var \Twig_Environment $twig */
/** @var \Symfony\Component\HttpFoundation\Session\Session $session */

Among a few other PHPdoc changes.
I'm willing to provide a patch, if this issue is going to be accepted.

[CloudSql] Wrong field type for the books table

Hi, it seems like when testing the 2-structured-data app, there is a small bug, which prevents the user from creating a Book record. The problem is that the create() method formats the publishedDate in the following format:

//controllers.php:66

$book['publishedDate'] = $d->setTimezone(
        	new \DateTimeZone('UTC'))->format("Y-m-d\TH:i:s\Z");

string(20) "2017-05-02T21:00:00Z"

And the insertion results in an error, because the publishedDate schema expects the format to be suitable for DATE:

$columns = array(
            'id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ',
            'title VARCHAR(255)',
            'author VARCHAR(255)',
            'publishedDate DATE',
            'imageUrl VARCHAR(255)',
            'description VARCHAR(255)',
            'createdBy VARCHAR(255)',
            'createdById VARCHAR(255)',
        );

The edit() method has the same problem.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

composer
authenticate-users/composer.json
  • php >=7.1
  • google/auth ^1.9
  • google/cloud-core ^1.32
  • kelvinmo/simplejwt ^0.4.0
background-processing/app/composer.json
  • google/cloud-pubsub ^1.16
  • google/cloud-firestore ^1.7
  • laravel/lumen-framework 5.8.*
background-processing/backend/composer.json
  • google/cloud-translate ^1.4
  • google/cloud-firestore ^1.7
  • google/cloud-functions-framework ^0.7.0
bookshelf/composer.json
  • php ^7.1.3
  • laravel/lumen-framework 5.8.*
  • google/cloud-storage ^1.11
  • google/cloud-firestore ^1.2
  • google/cloud-logging ^1.14
  • google/cloud-error-reporting ^0.18.0
  • symfony/dom-crawler ^5.0.0
  • symfony/css-selector ^5.0.0
gce/composer.json
  • laravel/lumen-framework 5.8.*
sessions/composer.json
  • google/cloud-firestore ^1.9
dockerfile
background-processing/backend/Dockerfile
  • composer 1

  • Check this box to trigger a request for Renovate to run again on this repository

Update GKE branding

  • change "Container Engine" to "Kubernetes Engine"
  • change "/container-engine/" to "/kubernetes-engine/" in URLs

I'm submitting PRs to other languages as we speak, please Cc me in the PR. @bshaffer

MongoDB warning on Travis

on Travis (see this build):

PHP Warning:  Module 'mongodb' already loaded in Unknown on line 0
Warning: Module 'mongodb' already loaded in Unknown on line 0

This may be because the mongodb extension is already compiled into PHP, and we are also installing it in .travis.yml via pecl

Can't deploy?

I'm not sure what I'm doing wrong.

Recently (over the past week) I've been getting an error deploying to the gcloud:
image

I've tried several ways of fixing it, even the firestore specific configuration and can't get it to deploy with ext-grpc.

I'm sure this worked a month or so ago because I was deploying; it is a recent change to gcloud.

I'll also note, when you install this program you get a warning
image

It seems pretty silly for demo code to be outdated. Is there someplace else I should be looking for PHP examples? Is PHP getting unsupported?

In env: flex, only the following runtimes are allowed

This is returning the following error when executing from google cloud console:
goapp serve app.yaml

In env: flex, only the following runtimes are allowed ('python-compat', 'java', 'java7', 'go', 'custom')

Not sure if google has changed something

Allow Custom Bucket Names

Since a project cannot always use its project ID as the bucket name, adjust the sample (in settings.yml) to allow for a different bucket name if necessary.

phpseclib "phpinfo" is causing execution to fail on Managed VMs

The phpseclib library used to validate ID Tokens is calling phpinfo to determine the OpenSSL version. Because phpinfo is blacklisted by suhosin, it will not run without special whitelisting in the Managed VMs environment.

Relevant Error:

# cat  /var/log/app_engine/suhosin.log    
Feb  8 19:45:53 [18] ALERT - function within blacklist called: phpinfo() (attacker '169.254.160.2', file '/app/vendor/google/apiclient/src/Goo
gle/AccessToken/Verify.php', line 78)
Feb  8 19:46:14 [18] ALERT - function within blacklist called: phpinfo() (attacker '169.254.160.2', file '/app/vendor/google/apiclient/src/Goo
gle/AccessToken/Verify.php', line 78)

add health checker

The logs are filling up with health checker 404 errors:

myapp.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /_ah/health" (uncaught exception) at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 123 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /_ah/health\" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php:123, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/_ah/health\". at /app/vendor/symfony/routing/Matcher/UrlMatcher.php:98)"} []
14:04:43.000
myapp.INFO: < 404 [] []

We should add a simple route to address this

Can't deploy hello world on windows

It appears that its having issues with docker setting the document root folder from app.yaml. For example cloning and deploying the code from https://github.com/GoogleCloudPlatform/getting-started-php/tree/master/1-hello-world returns this error:

Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
+ '[' -n '' ']'
+ NGINX_CONF_INCLUDE=/app/nginx-app.conf
+ '[' -n '' ']'
+ NGINX_CONF_OVERRIDE=/app/nginx.conf
+ '[' -f /app/nginx-app.conf ']'
+ mv /app/nginx-app.conf /etc/nginx/conf.d
+ '[' -f /app/nginx.conf ']'
+ '[' -n '' ']'
+ PHP_FPM_CONF_OVERRIDE=/app/php-fpm.conf
+ '[' -f /app/php-fpm.conf ']'
+ '[' -n '' ']'
+ PHP_INI_OVERRIDE=/app/php.ini
+ '[' -f /app/php.ini ']'
+ '[' -n '' ']'
+ SUPERVISORD_CONF_ADDITION=/app/additional-supervisord.conf
+ '[' -n '' ']'
+ SUPERVISORD_CONF_OVERRIDE=/app/supervisord.conf
+ '[' -f /app/additional-supervisord.conf ']'
+ '[' -f /app/supervisord.conf ']'
+ '[' -n '' ']'
+ '[' -z appweb ']'
+ sed -i 's|%%DOC_ROOT%%|appweb|g' /opt/nginx/conf/nginx.conf
+ '[' -f /app/composer.json ']'
+ grep -q post-deploy-cmd
+ su www-data -c 'php /usr/local/bin/composer --no-ansi run-script -l'
+ chown -R root.www-data appweb
chown: cannot access 'appweb': No such file or directory

It works fine on a mac. No changes have been made to the cloned code and just trying to run gcloud app deploy --no-promote --version hellotest

Google Cloud SDK 140.0.0
beta 2016.01.12
bq 2.0.24
bq-win 2.0.24
bundled-python 2.7.10
core 2017.01.17
core-win 2016.11.07
gcloud
gsutil 4.22
gsutil-win 4.20
powershell 1.0.0.1
windows-ssh-tools 2016.05.13

Bookshelf Cloud SQL app doesn't deploy.

The Bookshelf app does not yet have app.yaml or Dockerfile.

I tried this:
Create a Cloud SQL instance and database in my project.
Copy Dockerfile from Helloworld to Bookshelf.
Copy app.yaml from Helloworld to Bookshelf.
Add three environment variables to app.yaml:
env_variables:
MYSQL_DSN: 'mysql:host=173.194.83.205;dbname=books'
MYSQL_USER: phpapp
MYSQL_PASSWORD: steve

gcloud preview app deploy app.yaml --promote

The deployment seems to succeed:
Deployed module [default] to [https://steve-44.appspot.com]

When I go to https://steve-44.appspot.com, I get a 404.
Last week when I did a similar experiment I got a 500.

Hello world bug

When following the guide and running hello world, I get this in the browser:

Warning: DateTime::createFromFormat(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/beckwith/Code/getting-started-php/1-hello-world/vendor/symfony/http-foundation/Response.php on line 331
Hello World

How to Force SSL on Google App Engine Flexible Environment - PHP

Is there documentation showing how to force HTTPS on Google App Engine - Flexible PHP?

I tried placing secure on app.yaml and I had no luck.

I also tried in the nginx-app.conf placing this but no luck.

I also tried

set $test "";

if ($http_x_forwarded_proto = 'http') {
      set $test "http";
}

if ($test = 'http-non-cron') {
      return 301 https://$host$request_uri;
}

Other Option I tried

<?php 

header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload");  
exit();

?>

but no luck. 

Composer Modules

Some guzzle packages have been abandoned, update to use the guzzle/guzzle instead. See Screenshot.

This happened when I was following steps for Chapter 6-pubsub after running composer install

screen shot 2018-01-04 at 10 46 52 am

books/delete throws an exception

PHP message: [2018-01-11 21:15:43] myapp.CRITICAL: Google\Cloud\Core\Exception\NotFoundException: { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } } (uncaught exception) at /app/vendor/google/cloud/src/Core/RequestWrapper.php line 257 {"exception":"[object] (Google\Cloud\Core\Exception\NotFoundException(code: 404): {\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "notFound",\n "message": "Not Found"\n }\n ],\n "code": 404,\n "message": "Not Found"\n }\n}\n at /app/vendor/google/cloud/src/Core/RequestWrapper.php:257)"} []

I suspect this is because the code is trying to delete the image_url in an assumption that the file is in cloud storage, however, we use the URL from the books API as it is.

Bookshelf "Cloud Datastore" app doesn't deploy

Hi ,

I am using '2-structured-data' folder code provided in Github. I am able to execute code to localhost and its storing the data to the datastore when making an entry from localhost.

However, there is an issue when I deploy the application to the cloud.

As soon as "gcloud app deploy" is executed I am getting following response:


Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
'[' -n '' ']'
NGINX_CONF_INCLUDE=/app/nginx-app.conf
'[' -n '' ']'
NGINX_CONF_OVERRIDE=/app/nginx.conf
'[' -f /app/nginx-app.conf ']'
mv /app/nginx-app.conf /etc/nginx/conf.d
'[' -f /app/nginx.conf ']'
'[' -n '' ']'
PHP_FPM_CONF_OVERRIDE=/app/php-fpm.conf
'[' -f /app/php-fpm.conf ']'
'[' -n '' ']'
PHP_INI_OVERRIDE=/app/php.ini
'[' -f /app/php.ini ']'
mv /app/php.ini /opt/php/lib/conf.d
'[' -n '' ']'
SUPERVISORD_CONF_ADDITION=/app/additional-supervisord.conf
'[' -n '' ']'
SUPERVISORD_CONF_OVERRIDE=/app/supervisord.conf
'[' -f /app/additional-supervisord.conf ']'
'[' -f /app/supervisord.conf ']'
'[' -n '' ']'
'[' -z appweb ']'
sed -i 's|%%DOC_ROOT%%|appweb|g' /opt/nginx/conf/nginx.conf
sed -i 's|%%DOC_ROOT%%|appweb|g' /opt/php/lib/php.ini
/opt/php/bin/php /whitelist_functions.php
'[' -f /app/composer.json ']'
grep -q post-deploy-cmd
su www-data -c 'php /usr/local/bin/composer --no-ansi run-script -l'
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php56/lib/php/ex
tensions/no-debug-non-zts-20131226/memcached.so' - /opt/php56/lib/php/extensions
/no-debug-non-zts-20131226/memcached.so: cannot open shared object file: No such
file or directory in Unknown on line 0
chown -R root.www-data appweb
chown: cannot access 'appweb': No such file or directory

Is there any setting has to be configured in the dashboard OR any changes in .yaml?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.