Monthly Archives: May 2013

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.

PHP runtime new feature requests

It’s great to see so much interest in the PHP runtime we released at I/O – and there are some cool blog posts starting to appear that showing how to get various frameworks and applications up and running.

When we were building the runtime we needed a way to prioritize what PHP extensions we should support at launch. The obvious way to do that is to pick one of the popular PHP apps and get it to work, and then build from there. As you can see from our I/O session we picked WordPress.

So now we get to the inevitable “Hey you forgot popular extension ‘X’ that I need to run popular framework ‘Y'” types of questions and discussions. Never fear comrades, the extensions that we include in the runtime are far from set in stone – and we’re really looking now for the community to tell us what it is they need to get their applications working well on App Engine.

To this end, the best place to tell us what’s missing is in the issue tracker. You can see what people have already raised here, and if what you need is already listed then “star” the issue to let us know it’s important.

If what you need is not listed, then go and add a new feature request and let us know what you need and why it’s important. Other developers can then star your issue as well and we can easily see what the majority of the community requires. Make sure you add “Language-PHP” to the labels of the issue your create.

Of course, some items might not be PHP specific but overall feature requests or bugs for App Engine – you should use the same process to file issues for the overall platform, using the label field of the issue to categorize it as best you can.

PHP, meet App Engine. App Engine, meet PHP.

Yesterday at Google I/O we announced the launch of the PHP runtime for App Engine.

In fact, we’re making this post from our I/O Session where we’re talking all about PHP on App Engine.

Now sadly while not everybody can be here with us in San Francisco, the great news is that the session is being live streamed right here, so come and learn all about how we’ve enabled hosting the worlds most popular web language on the worlds best cloud infrastructure.

For more information you can also visit GAE for PHP and sign up for access to the runtime, download the SDK and find links to the documentation.