2013-11-21 47 views
2

我正在用我遇到的這個問題撕裂我的頭髮。我正在安裝Wordpress到我的NearlyFreeSpeech網絡服務器上。我已經建立了我的MySQL數據庫等等,它工作得很好。我建立了一個名爲wpuser的用戶和一個名爲wpuser的數據庫,並給出了wpuser創建/刪除等的適當權限。在NearlyFreeSpeech託管服務器上設置Wordpress

我編輯我的wp-config.php究竟是如何NearlyFreeSpeech常見問題列表。

在命中安裝按鈕我得到的錯誤是這樣的:

WordPress database error: [Can't create/write to file '/var/wordpress/wp_users.MYI' (Errcode: 2)]` 

然後就是漫長的MySQL查詢如下。我沒有權限訪問服務器上公共/私人文件夾以外的任何內容,所以我不知道爲什麼Wordpress會嘗試將自己安裝到var文件夾中,或者至少訪問不在其中的文件夾。

的搜索建議我給WordPress的一個臨時目錄中一點點,這是我使用此代碼完成的:

if (!defined('WP_TEMP_DIR')) 
    define('WP_TEMP_DIR', dirname(__FILE__) . '/tmp/'); 

我如何能得到這個東西實際安裝有什麼建議?


wp-config.php

<?php 
/** 
* The base configurations of the WordPress. 
* 
* This file has the following configurations: MySQL settings, Table Prefix, 
* Secret Keys, WordPress Language, and ABSPATH. You can find more information 
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing 
* wp-config.php} Codex page. You can get the MySQL settings from your web host. 
* 
* This file is used by the wp-config.php creation script during the 
* installation. You don't have to use the web site, you can just copy this file 
* to "wp-config.php" and fill in the values. 
* 
* @package WordPress 
*/ 

// ** MySQL settings - You can get this info from your web host ** // 
/** The name of the database for WordPress */ 
define('DB_NAME', 'wpuser'); 

/** MySQL database username */ 
define('DB_USER', 'wpuser'); 

/** MySQL database password */ 
define('DB_PASSWORD', "passwordhere"); 

/** MySQL hostname */ 
define('DB_HOST', 'nescience.db'); 

/** Database Charset to use in creating database tables. */ 
define('DB_CHARSET', 'utf8'); 

/** The Database Collate type. Don't change this if in doubt. */ 
define('DB_COLLATE', ''); 



if (!defined('WP_TEMP_DIR')) 
    define('WP_TEMP_DIR', dirname(__FILE__) . '/tmp/'); 





/**#@+ 
* Authentication Unique Keys and Salts. 
* 
* Change these to different unique phrases! 
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} 
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. 
* 
* @since 2.6.0 
*/ 
define('AUTH_KEY',   'put your unique phrase here'); 
define('SECURE_AUTH_KEY', 'put your unique phrase here'); 
define('LOGGED_IN_KEY', 'put your unique phrase here'); 
define('NONCE_KEY',  'put your unique phrase here'); 
define('AUTH_SALT',  'put your unique phrase here'); 
define('SECURE_AUTH_SALT', 'put your unique phrase here'); 
define('LOGGED_IN_SALT', 'put your unique phrase here'); 
define('NONCE_SALT',  'put your unique phrase here'); 

/**#@-*/ 

/** 
* WordPress Database Table prefix. 
* 
* You can have multiple installations in one database if you give each a unique 
* prefix. Only numbers, letters, and underscores please! 
*/ 
$table_prefix = 'wp_'; 

/** 
* WordPress Localized Language, defaults to English. 
* 
* Change this to localize WordPress. A corresponding MO file for the chosen 
* language must be installed to wp-content/languages. For example, install 
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German 
* language support. 
*/ 
define('WPLANG', ''); 

/** 
* For developers: WordPress debugging mode. 
* 
* Change this to true to enable the display of notices during development. 
* It is strongly recommended that plugin and theme developers use WP_DEBUG 
* in their development environments. 
*/ 
define('WP_DEBUG', false); 

/* That's all, stop editing! Happy blogging. */ 

/** Absolute path to the WordPress directory. */ 
if (!defined('ABSPATH')) 
    define('ABSPATH', dirname(__FILE__) . '/'); 

/** Sets up WordPress vars and included files. */ 
require_once(ABSPATH . 'wp-settings.php'); 
+0

您是否使用了正確的數據庫服務器?它可能不是'localhost',但我不知道NearlyFreeSpeech設置的細節。 –

+0

錯誤代碼2意味着沒有找到文件,我相信。你確定你已經指定了正確的主機服務器嗎? – ggdx

+0

我的數據庫主機是其常見問題解答建議的' .db'。如果我使用不同的垃圾信件,頁面甚至不會加載,它只是給我提供了'建立數據庫連接的錯誤'。所以,遺憾的是我不認爲這是問題。 如果'errcode 2'找不到文件,爲什麼要在'/ var'下尋找一個wordpress目錄? – taylorthurlow

回答

0

nescience.db不是數據庫服務器的地址。它無法解析。數據庫的URL位於PHP My Admin的頂部。


編輯:

一些託管公司在同一個實例作爲Apache的安裝MySQL。它值得一試localhost

/** MySQL hostname */ 
define('DB_HOST', 'localhost'); 

編輯

更正:nescience.db可能是爲MySQL服務器的正確名稱。在NearlyFreeSpeech上,這是他們如何命名他們的數據庫。

+1

在我的託管服務提供商的情況下,它是。 http://i.imgur.com/lKbXhH3.png 儘管它不是傳統的主機名,但它是NFS所要求的。順便提一下,我改變了數據庫名稱,這就是爲什麼它是一個不同的名稱。 – taylorthurlow

+0

@frizkie看到我更新的答案。 – stink

+0

沒有運氣。每當我將主機名更改爲「nescienceband.db」以外的內容時,我甚至無法進入安裝頁面,它只是給我一個錯誤,並且不會加載頁面。我很確信主機名是正確的。我很感激幫助。 – taylorthurlow

1

我知道這是舊的,但我認爲這將有助於回答。 我遵循了這一建議,並就工作得很好:

https://members.nearlyfreespeech.net/YOURMEMBERNAME/support/wordpress

也看到這一點:

http://www.reddit.com/r/Wordpress/comments/18e5n9/anyone_use_nearlyfreespeech_as_a_webdev_babynoob/

摘要:

touch .htaccess 
chgrp web .htaccess 
chmod 664 .htaccess 
chgrp -R web * 
find . -type d -exec chmod 775 {} \; 
find . -type f -exec chmod 664 {} \; 

你的wp-config.php文件容貌精細。你的數據庫名稱看起來正確

您是否使用wp-cli下載wordpress?這就是我所做的,它運作良好。

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar  
php wp-cli.phar core download 

然後,我調用此:

http://MYSITENAME.nfshost.com/wp-admin/install.php

和它的所有工作。

+0

我確實已經過了需要這些信息的地步,但我真的很感謝你發佈這個 - 這看起來應該是這個解決方案。 – taylorthurlow

0

這實際上是關於在WordPress和NFS中用於數據庫事物的名稱。

在phpMyAdmin在您的網站......在頁面找... 服務器的頂部:name1.db»數據庫:NAME2

定義( 'DB_NAME',名2' ); define('DB_HOST','name1.db'); 用戶名和密碼是針對您爲此MYSQL網站製作的用戶。 希望這會有所幫助