0

私が達成しようとしていることは、非常に単純なようです。ライブ バージョンの wordpress をローカル マシンにプルし、localhost で実行して、テーマで遊んだり、dreamweaver などで編集したりしたいと考えています。これは、最新バージョンの 3.6.1 に更新されたばかりのマルチサイト wp であることに注意してください。

私が抱えている問題は、localhost が私のルート フォルダーを適切な場所にあると認識しても、サイトを開いて実行しないことです。「要求された URL/wp-signup.php がこのサーバー上で見つかりませんでした」など、多数のエラーが発生しましたが、最新のものは奇妙なものです。

非推奨: mysql_connect(): mysql 拡張機能は非推奨であり、将来削除される予定です: 代わりに、/Applications/MAMP/htdocs/lifefarout/www/wp-includes/wp-db.php の 1142 行で mysqli または PDO を使用してください

警告: ヘッダー情報を変更できません - /Applications/MAMP/htdocs/lifefarout/www/ の (/Applications/MAMP/htdocs/lifefarout/www/wp-includes/wp-db.php:1142 で開始された出力) によって既に送信されたヘッダー91 行目の wp-includes/ms-settings.php

これは行番号 1142 です

$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );

これは91行目です

header( 'Location: ' . $destination );

私のマシン: OSX 10.8.5、MAMP バージョン 2.2 (Apache と Mysql の両方が正常に動作しています)

これまでに行ったこと: ftp を使用して、www/ フォルダーを、MAMP が指しているローカル コンピューターの .htdocs フォルダーに転送しました。phpmyadmin を使用してサーバーから .sql データベースをバックアップしました。エクスポートしたものと同じ名前で、ローカル phpmyadmin にデータベースを作成しました。インポートされたデータベース。ユーザーを作成しました。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', 'lifefa5_lifefarout');

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

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

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

/** 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', '');

/**#@+
 * 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',         '.*>a;snGx`hMa6&2|X$3g/:k3k6FYF]Z|+K1[>vADAQ/KHt]S:0WBLq|T-m>1Co7');
define('SECURE_AUTH_KEY',  'x+Xphn TxO|<h -M>o|sOG2iyic*}oWpf71jsd&|ma5x;b6Q,*47ZPgpPrZnb ]#');
define('LOGGED_IN_KEY',    'v?o{lCRqbMf)_rrq*c8z3Ey!*e>&d+Ee<K{aWUfnF@i%#j|A8rBv(9u7i@l ]-0t');
define('NONCE_KEY',        'PFj08]|>D[p?b+|Iz8%8-N>-#k+9>Li-1v<e;l2=-TOBnt&rRA-ZK/|Pk#v1r-h_');
define('AUTH_SALT',        'WEj#d~*= |!3uwI`~;@*+5I_WD7[4_0X_3=5Ev*zL^Cr+guSLu-U3(+HewIO:-QV');
define('SECURE_AUTH_SALT', '_I(.y=F`$PUe}-d~||u%`E6DO!|H^r00EK>/T((M*F<-n0B|b5$^GjUAeokg:<gW');
define('LOGGED_IN_SALT',   'w(4G,N.#@a!>~Svw|h[|-AI`}?OyYxs3FT)O2:FydEWx?M@Pmm8u!ik.$fRov0|r');
define('NONCE_SALT',       '2<aWfduVE8Anry(E jTg+(*%cE{-z0p_<V .FOe}xW}8-@(5mTpU3%J5n:Xc]+Gr');

/**#@-*/

/**
 * 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', 'true');

define('WP_ALLOW_MULTISITE', 'true');

define('MULTISITE', 'true');
define('SUBDOMAIN_INSTALL', 'false');
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/* 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');

また、次のように .htaccess を編集しました。

# To set your custom php.ini, add the following line to this file:
# suphp_configpath /home/yourusername/path/to/php.ini

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>

# END WordPress
RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.co$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lfarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.info$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.me$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.mobi$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.net$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.org$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^mylfo\.mobi$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^mylfo\.net$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^mylifefarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^ourlfo\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^eventsfarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^livefarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^livingfarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.us$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifefarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^livelifefarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^lifefarout\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.lifefarout\.com$
RewriteRule ^lifeisfarout\.com$ "http\:\/\/lifefarout\.com\/" [R=301,L]

私はまだstackoverflowにまったく慣れていないので、どんな助けでも大歓迎です。私はWPに非常に慣れていないので、欠けているものがあると確信しています。

さらに詳しい情報が必要な場合、または追加のファイルを共有したい場合は、お知らせください。喜んでお手伝いさせていただきます。前もって感謝します。

4

4 に答える 4

0

WordPress のデバッグモードをオフにすると、このメッセージを非表示にすることができます。

変化する

define('WP_DEBUG', 'true');

define('WP_DEBUG', 'false');
于 2013-11-09T11:46:16.720 に答える
0

WP_DEBUGWordPress でエラー警告を変更するには、 true に設定して以下を実行できます。

  1. wp-contentフォルダーに、という名前の新しいフォルダーを作成しますmu-plugins
  2. このフォルダーに、使用するエラー レベルの php ファイルを作成します。

例えば:

 //turns off deprecated and strict errors
    error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);

ここでリストを見ることができます: http://www.php.net/manual/en/errorfunc.constants.php

于 2013-12-31T17:53:53.933 に答える
0

The warning about mysql_connect() means that the version of PHP you are running, considers the "mysql" extension as being deprecated and suggests other extensions. So in a future PHP version, this version of Wordpress won't work, unless configured to use these other extensions (if that's possible).

However this warning is just a warning and is not related with the other error "not found".

于 2013-10-13T13:16:45.390 に答える