Setting up phpMyAdmin on App Engine

Note: This article is obsolete. Current instructions for installing phpMyAdmin can be found here.

I’ve had a few requests for publishing how to get phpMyAdmin up and running. No doubt we’ll add this as a tutorial to the developers.google.com soon but in the meantime I thought I’d add it here.

    1. Download the phpMyAdmin source code from here.
    2. Create a directory named phpMyAdmin and move the downloaded zip file to it.
    3. Unzip the package. The following instructions assume that you unzip the contents of the downloaded package into a subfolder named ‘phpMyAdmin’ for simplicity.
    4. Create a file ‘app.yaml’ in the root folder and add the following contents.

 

application: myapplication
version: phpmyadmin
runtime: php
api_version: 1

handlers:
- url: /(.*\.(ico$|jpg$|png$|gif$))
static_files: phpMyAdmin/\1
upload: phpMyAdmin/(.*\.(ico$|jpg$|png$|gif$))
application_readable: true

- url: /(.*\.(htm$|html$|css$|js$))
static_files: phpMyAdmin/\1
upload: phpMyAdmin/(.*\.(htm$|html$|css$|js$))
application_readable: true

- url: /(.*\.(php$))
script: phpMyAdmin/\1
secure: always
login: admin

- url: /(.+)
script: phpMyAdmin/index.php
secure: always
login: admin

- url: /
script: phpMyAdmin/index.php
secure: always
login: admin

 

    1. You should end up with a directory hierarchy something like

 

-- phpMyAdmin
+ app.yaml
+ phpMyAdmin/
-- browse_foreigners.php
-- bs_disp_as_mime_type.php

 

    1. Now you can create the phpMyAdmin configuration file.

 

$ cp phpMyAdmin/config.sample.inc.php phpMyAdmin/config.inc.php

 

    1. Edit the phpMyAdmin/config.inc.php file and configure the first server to use the Cloud SQL instance that you already have.

 

// Change this to use your project and instance that you've created.
$host = '/cloudsql/my-project:my-instance';
$type = 'socket';

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['socket'] = $host;
$cfg['Servers'][$i]['connect_type'] = $type;
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

 

    1. Add the following entries to the end of config.inc.php.

 

$cfg['McryptDisableWarning'] = true;
$cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['ExecTimeLimit'] = 60;
$cfg['CheckConfigurationPermissions'] = false;

 

    1. Now you can push phpMyAdmin as a version of your application.

 

$ appcfg.py -R -A my_application_id -V phpmyadmin update .

 

    1. Now you can access phpMyAdmin using version addressing

 

http://phpmyadmin-dot-my_application_id.appspot.com

phpMyAdmin has a plethora of options, and what is listed here is only the basics to get it up and running. If you find any problems please file an issue here.