无法启动Google Cloud phpMyAdmin页面


Can't start up Google Cloud phpMyAdmin page?

我正在尝试使用以下链接为Google Cloud设置phpMyAdmin页面,我在这个网站上100%遵循:https://cloud.google.com/sql/docs/phpmyadmin-on-app-engine当我尝试运行php服务器时,看看它是否启动并运行,我做以下操作:

C02Q202LG8WL:phpMyAdmin user$ appcfg.py update .
01:26 AM Application: database-140707; version: 2
01:26 AM Host: appengine.google.com
01:26 AM Starting update of app: database-140707, module: phpmyadmindb, version: 2
01:26 AM Getting current resource limits.
01:26 AM Scanning files on local disk.
01:26 AM Scanned 500 files.
01:26 AM Scanned 1000 files.
01:26 AM Scanned 1500 files.
01:26 AM Scanned 2000 files.
01:26 AM Cloning 1113 static files.
01:27 AM Rolling back the update.
Error 409: --- begin server output ---
No transaction is in progress.
--- end server output ---

我们一直得到这个No transaction is in progress.错误。它使我无法加载localhost/phpmyadmin页面。知道为什么会这样吗?如果我尝试回滚事务的更改,则执行:

C02Q202LG8WL:phpMyAdmin user$ /usr/local/google_appengine/appcfg.py rollback database-140707/
01:30 AM Application: database-140707
01:30 AM Host: appengine.google.com
01:30 AM Rolling back the update.
C02Q202LG8WL:phpMyAdmin user$ appcfg.py update .
01:30 AM Application: database-140707; version: 2
01:30 AM Host: appengine.google.com
01:30 AM Starting update of app: database-140707, module: phpmyadmindb, version: 2
01:30 AM Getting current resource limits.
01:30 AM Scanning files on local disk.
01:30 AM Scanned 500 files.
01:30 AM Scanned 1000 files.
01:30 AM Scanned 1500 files.
01:30 AM Scanned 2000 files.
    Error 409: --- begin server output ---
There is an operation pending for this application: AppLock held for "Updating engine_version_id='2' within engine_id='default'." acquired by <Insert User> at 2016-08-19 08:26:05.734255 GMT.  Please wait and try again or use 'appcfg rollback' to attempt to cleanly abort the current operation.
--- end server output ---

我似乎弄不清楚为什么我不能在谷歌云上启动phpMyAdmin,我不知道为什么或这些错误来自哪里。任何帮助都会很感激。谢谢。

编辑:

我实际上把所有东西都正确地部署了。我所要做的就是把app.yaml从模块phpmyadmindb换成default。下面是我创建的app.yaml:

application: database-140707
service: default
runtime: php55
api_version: 1
version: 3
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

config.inc.php:

<!-- [START all] -->
<?php
// [START_EXCLUDE silent]
/**
 * Copyright 2016 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// [END_EXCLUDE]
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 * http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
 */
$cfg['blowfish_secret'] = '<Blow Fish Generator>'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/*
 * Servers configuration
 */
$i = 0;
// Change this to use the project and instance that you've created.
$host = '/cloudsql/<Cloud SQL Instance Name>';
$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;
/*
 * End of servers configuration
 */
/*
* Other settings
*/
$cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['ExecTimeLimit'] = 60;
$cfg['CheckConfigurationPermissions'] = false;
// [END all]
php . ini:

google_app_engine.enable_functions = "php_uname, getmypid"

下面是成功的输出:

C02Q202LG8WL:phpMyAdmin schan$ appcfg.py update .
01:12 PM Application: database-140707; version: 3
01:12 PM Host: appengine.google.com
01:12 PM Starting update of app: database-140707, version: 3
01:12 PM Getting current resource limits.
01:12 PM Scanning files on local disk.
01:12 PM Scanned 500 files.
01:13 PM Scanned 1000 files.
01:13 PM Scanned 1500 files.
01:13 PM Scanned 2000 files.
01:13 PM Cloning 1113 static files.
01:13 PM Cloning 2276 application files.
01:13 PM Cloned 2000 files.
01:13 PM Uploading 3 files and blobs.
01:13 PM Uploaded 3 files and blobs.
01:13 PM Compilation starting.
01:13 PM Compilation completed.
01:13 PM Starting deployment.
01:13 PM Checking if deployment succeeded.
01:13 PM Deployment successful.
01:13 PM Checking if updated app version is serving.
01:13 PM Completed update of app: database-140707, version: 3

现在我遇到的问题是,教程说导航到https://phpmyadmindb-dot-database-140707.appspot.com/查看phpmyadmin是否设置正确。当我在那里导航,然而,我得到的是一个屏幕,说Hello World!,但没有实际的phpMyAdmin似乎被部署。我试着去https://phpmyadmindb-dot-database-140707.appspot.com/index.php看看它是否被创建,但它不是。有人知道为什么吗?

日志建议您的应用程序有多个服务/模块-我看到日志引用到phpmyadmindb一个,也有default模块的任何应用程序。也许你只是错过了这一步在创建app.yaml部分的教程:

  • 如果你在App Engine中部署phpMyAdmin作为第一个也是唯一的应用,将service的值从phpmyadmin更改为default
  • 通常,您会将phpMyAdmin部署为现有的应用程序,并为服务提供一个名称。然而,如果你尚未部署应用程序,则需要使用服务名称default。这对于本教程的目的来说是很好的如果你只是在App Engine上尝试phpMyAdmin

    我个人会用first and only service of your application代替first and only application in App Engine。不管怎样…

    对于多模块应用程序,你应该而不是以典型/经常记录的方式使用SDK实用程序(dev_appserver.py, appcfg.py等)-通过指定应用程序的目录(在你的情况下是.)。换句话说,不要让这些实用程序自己决定对哪些服务进行操作(这可能会导致意想不到的结果),而是习惯于通过各自服务/模块的.yaml文件列表显式地指定它们。

    在引入服务支持后,许多文档/教程没有更新,并且仍然建议在使用SDK实用程序时指定应用程序(通过ID或通过应用程序目录)-这仅在单模块应用程序中是无歧义的。明确地指定服务/模块——通过它们各自的.yaml文件——对于单服务和多服务应用程序都保持不模棱两可,并且对人为错误的容错性更低。顺便说一句,这是dev_appserver.py目前的默认值(SDK 1.9.40),但仍然不是appcfg.py的默认值(与--help一起运行以检查语法)。

    回到你的案例细节…

    更新和回滚错误都表明尝试是针对phpmyadmindb模块的,但是第二个错误表明锁是为default模块的更新而持有的。尝试显式回滚default模块的更新(如果您确实错过了上面引用的步骤,则在执行之后),希望这将释放锁并允许后续部署。

    还要检查.yaml文件中是否存在正确的服务/模块名称——很容易忽略,特别是在创建新服务和从现有模块复制粘贴文件时。这种情况以及对服务/模块名称的更改可能会导致SDK实用程序和/或应用/服务/模块部署的混淆,因此应小心执行。