2016-08-19 73 views
0

我尝试使用以下链接设置Google云端的phpMyAdmin页面,我在此网站上使用了下列链接:https://cloud.google.com/sql/docs/phpmyadmin-on-app-engine当我尝试运行php服务器以查看它是否已启动并运行时,我执行以下操作:无法启动Google云端phpMyAdmin页面?

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 

现在我遇到的问题是临屋区t教程说导航到https://phpmyadmindb-dot-database-140707.appspot.com/以查看phpmyadmin是否设置正确。然而,当我在那里导航时,我得到的只是一个屏幕,显示Hello World!,但似乎没有部署实际的phpMyAdmin。我试图去https://phpmyadmindb-dot-database-140707.appspot.com/index.php看看是否创建了,但它不是。有谁会碰巧知道为什么?

回答

0

日志表明你的应用程序有多个服务/模块 - 我看到的日志引用为phpmyadmindb之一,并且还有用于任何应用程序的default模块。也许你只是错过了这个步骤在教程的Create app.yaml部分:

  • 如果部署成功运行在应用程序引擎的第一和唯一的应用程序,服务从改变值phpmyadmindefault
  • 通常,您可以将phpMyAdmin作为现有 应用程序的服务进行部署,并为该服务提供一个名称。但是,如果您的 尚未部署应用程序,则需要使用 服务名称“default”。对于本教程 而言,如果您只是在App Engine上尝试使用phpMyAdmin,那很好。

    就我个人而言,我会在该段中将first and only application in App Engine替换为first and only service of your application。无论如何...

    对于多模块应用程序,你应该使用SDK工具(dev_appserver.pyappcfg.py等),在典型的/常记录的方式 - 通过(在你的情况.)指定应用程序的目录。换句话说,不要让这些实用程序自己决定运行哪些服务(这可能会导致意外的结果),而是习惯于通过各个服务/模块的文件列表明确指定它们。

    许多文件/导入了服务的支持后未更新教程和还是建议使用SDK的实用程序,当应用程序(通过ID或应用程序目录)指定- 这是无歧义仅在单模块应用。指定服务/模块明确地改为 - 通过它们各自的.yaml文件 - 对于两个单一和多服务应用程序仍然是非模糊的,并且不容忍人为错误。这是BTW,目前为dev_appserver.py(SDK 1.9.40)的默认值,但仍不是appcfg.py的默认值(使用--help运行它们来检查语法)。

    回到你的情况具体...

    无论是更新和回滚错误指示尝试都为phpmyadmindb模块,但第二个错误指​​示锁举行的default模块的更新。尝试显式回滚default模块的更新(如果您确实错过了执行引用步骤之后),希望这会释放锁定并允许后续部署。

    同时检查.yaml文件中是否存在正确的服务/模块名称 - 尤其是在创建新服务和复制粘贴现有模块中的文件时,尤其容易遗漏。此类情况以及对服务/模块名称的更改可能会导致SDK实用程序和/或应用程序/服务/模块部署混淆,因此应该小心谨慎。

    +0

    非常感谢你的彻底回应。我有部署服务器,但教程说导航到'https:// phpmyadmindb-dot-database-140707.appspot.com /'来查看phpmyadmin是否设置正确。当我去那里时,我得到的是一个显示'Hello World!'的屏幕,但似乎没有部署phpMyAdmin GUI。我包含了我的app.yaml,并确保'config.inc.php'指向正确的'$ host'(我部署的CloudSQL实例)。任何帮助,将不胜感激。谢谢! – user1871869

    +0

    我在PHP是NULL。但由于您的案例中的模块是重命名后的默认模块,因此我希望相关URL可以根据https://database-140707.appspot.com /(即您的应用默认的默认模块版本)通过URL进行路由(https://cloud.google.com/appengine/docs/python/how-requests-are-routed#routing_via_url)。 –