EasyEngine 在建立 WordPress 網站的程序是利用 WP-CLI 命令來執行;先下載 WordPress 核心程式到你的主機 /tmp 目錄底下,解壓縮後放到 /root/.wp-cli/cache/core 目錄下,才開始安裝。
今天在一台 VPS 主機上安裝 WordPress 4.8.2 版時,發生錯誤,如下:
PHP7.0 is experimental feature and it may not work with all CSS/JS/Cache of your site. Do you wish to install PHP 7.0 now for demo14.newbieboss.com? Type "y" to continue [n]:y Running pre-update checks, please wait... Setting up NGINX configuration [Done] Setting up webroot [Done] Downloading WordPress [Fail] Oops Something went wrong !! Calling cleanup actions ... 'ee_mysql_grant_host'
看似 MySQL 連線錯誤,無法建立資料庫。
打開 ee.log 來找原因,是在哪一環節出錯,看到這一行,如下:
Command Error: Warning: PharData failed, falling back to 'tar gz' (unable to decompress gzipped phar archive "/tmp/wp_59c62b6d1cac9.tar.gz" to temporary file)
下載的 WordPress 核心程式,無法解壓縮。
疑 ? /tmp 的權限設置示沒問題的,怎麼會發生這種問題,搜尋 EasyEngine 論壇,看看有沒有跟我一樣的問題。
原來是 WP-CLI 版本的原因,將 WP-CLI 升級到最新版,可以解決建立 WordPress 網站的錯誤。
WP-CLI 升級方法:
原本 EasyEngine 的 WP-CLI 升級就好,不須再安裝一次。(9/27 修正)
安裝 WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/bin/wp
檢查 WP-CLI 是否安裝成功:
wp --info
更新 WP-CLI
運行 wp cli update –nightly 這個指令,保持最新的 WP-CLI。
wp cli update --nightly
如果是 root 帳號登入,請執行:
wp cli update --nightly --allow-root
回覆
You have version 1.3.0. Would you like to update to the latest nightly? [y/n] y Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar... md5 hash verified: f11b200db862f03e5de23cba4fdb4f5c New version works. Proceeding to replace. Success: Updated WP-CLI to the latest nightly release.
然後再一次執行建立 WordPress 網站,就可以順利安裝:
sudo ee site create site.com --wp
參考資料:
WP-CLI Installing
http://wp-cli.org/#installing
Featured Photo 攝影師:Snapwire,連結:Pexels
可以請問當ee安裝好wp時
有沒辦法在還沒有將網域指過去VPS
就可以先訪問WP網站?
或是訪問phpMyAdmin?
A 紀錄若沒指向新的 VPS 時,是沒有辦法訪問 WP 網站。
訪問 phpMyAdmin 的方法:
http :// 你的 IP:22222
不用理會警告,點進階進入 → 網頁認證 → Index of /
點取 db/ → pma/ → phpMyadmin 管理
若出現警告,請參考下面網址修復
https://support.gtour.info/viewtopic.php?f=17&t=50
進去了!
一直看到要到22222
可是不知道原來還要到db/pma
也遇到警告問題
照著步驟解決了
感謝
可以幫到你,很高興。