2016-08-19 48 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)。 –

    相關問題