skip to Main Content

I have a simple application that I have downloaded from git installed on one instance of Google App Engine.
https://github.com/ssl/ezXSS

I have a second app engine instance where I followed the phpmyadmin tutorial in the link below to install phpmyadmin to administer my mysql database in google cloud services.
https://cloud.google.com/sql/docs/mysql/phpmyadmin-on-app-engine

for the simple app and the phpmyadmin, the app.yaml is pretty much the same

service: default
runtime: php72

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: auto
  secure: always
  #login: admin

- url: /.*
  script: auto
  secure: always
  #login: admin

both instances display their initial page fine, but after the submit or login, they both complain about cookies.

my simple app should be writing to the database from the first page but I get this error

This page isn’t working
XXXXXXXXXX.appspot.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

From PHPmyadmin I get

There is mismatch between HTTPS indicated on the server and client. This can lead to non working
phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly.

and

Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.

its not a browser issue…..I have cleared the cookies and data related to these sites. I have tried in both chrome and firefox with the same result.

I am using App Engine standard environment for both app engine instance.

both instances, the initial pages are showing as secure…..
the simple app after submitting says its not secure when it returns the message about the cookie

edit:

after further investigation it appears I am making a connection with the mysql database, both using PDO and mysqli. But I can’t seem to do much more than make a connection. getAttribute for PDO seems to be about the only thing that works.
If I make a fetch or a query it fails, though the same fetch or query in the google cloud shell using the same user works fine.

Seems like a GAE or php or mysql config issue?

2

Answers


  1. Chosen as BEST ANSWER

    I didn't realize there was an ability to see the GAE php logs, so that I could see what was failing.

    I finally managed to get some basic sql working and then tested the table creation that ezxss was trying to perform, and it turned out it wasn't working and wasn't throwing an error.

    Though it would throw an error if I pasted into cloud shell.... complaining about ENGINE=MyISAM

    so this code

    $this->database->query('CREATE TABLE IF NOT EXISTS `settings` (`id` int(11) NOT NULL AUTO_INCREMENT,`setting` varchar(500) NOT NULL,`value` text NOT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;');
    
    $this->database->query('CREATE TABLE IF NOT EXISTS `reports` (`id` int(11) NOT NULL AUTO_INCREMENT,`shareid` VARCHAR(50) NOT NULL,`cookies` text,`dom` longtext,`origin` varchar(500) DEFAULT NULL,`referer` varchar(500) DEFAULT NULL,`uri` varchar(500) DEFAULT NULL,`user-agent` varchar(500) DEFAULT NULL,`ip` varchar(50) DEFAULT NULL,`time` int(11) DEFAULT NULL,`archive` int(11) DEFAULT 0,`screenshot` LONGTEXT NULL DEFAULT NULL,`localstorage` LONGTEXT NULL DEFAULT NULL, `sessionstorage` LONGTEXT NULL DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;');
    

    got changed to

    $this->database->query('CREATE TABLE IF NOT EXISTS `settings` (`id` int(11) NOT NULL AUTO_INCREMENT,`setting` varchar(500) NOT NULL,`value` text NOT NULL,PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;');
    
    $this->database->query('CREATE TABLE IF NOT EXISTS `reports` (`id` int(11) NOT NULL AUTO_INCREMENT,`shareid` VARCHAR(50) NOT NULL,`cookies` text,`dom` longtext,`origin` varchar(500) DEFAULT NULL,`referer` varchar(500) DEFAULT NULL,`uri` varchar(500) DEFAULT NULL,`user-agent` varchar(500) DEFAULT NULL,`ip` varchar(50) DEFAULT NULL,`time` int(11) DEFAULT NULL,`archive` int(11) DEFAULT 0,`screenshot` LONGTEXT NULL DEFAULT NULL,`localstorage` LONGTEXT NULL DEFAULT NULL, `sessionstorage` LONGTEXT NULL DEFAULT NULL,PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;');
    

  2. I followed the tutorial you mentioned and I was able to deploy successfully phpmyadmin in App Engine Standard.
    However I did face some issues getting the blowfish secret key for the config.inc.php file. The tutorial sends you here to get the key but I got nothing, only the example key. So, I used this other website to get the key.

    Some other things you could check are if your Cloud SQL Instance is a 2nd generation instance, php runtime (I used php55).

    Mmmm forgot to mention that I deployed phpmyadmin as my first service(default) within App Engine. So, you might also want to try that, creating new project, new app engine and deploy phpmyadmin as your first service.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search