end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

install wordpress 5.8 to php + iis for win11

wordpress + php + iis の構成は殆ど見たことのない構成ですが、メモ。

目次

step 1 - php + iis for win11 環境

と言っても、先日の以下のurlに記載の通りです。

iis for win11 に fastcgi な php 環境の構築 - end0tknr's kipple - web写経開発

step 2 - mysql for wordrecreate

まず、create database & create user

mysql> CREATE USER 'wordpress'
         IDENTIFIED WITH mysql_native_password
         BY 'ないしょ';

mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL ON wordpress.* TO 'wordpress';

その後の windowsから作成したdatabaseへの接続testの為、 Connector/ODBC を利用すると、よいかと思います。

MySQL :: Download Connector/ODBC

f:id:end0tknr:20220115084100p:plain

step 3 - download wordrecreate & unzip

まず、

から、ダウンロードし、

c:/inetpub/wwwroot/wp

として、解凍してください。

wordpressは、上記dirへの書込みを必要とするようですので、 以下のように権限を付与します。

f:id:end0tknr:20220115084113p:plain

step 4 - edit wp-config.php

install php ver.7.3.15 and wordpress ver.5.3.2 - end0tknr's kipple - web写経開発

↑こちらのentryのように wp-config.php を編集します。

DOS> cd c:/inetpub/wwwroot/wp
DOS> cp wp-config-sample.php wp-config.php

DOS> vi wp-config.php
<?php
define( 'DB_NAME',     'wordpress' );
define( 'DB_USER',     'wordpress' );
define( 'DB_PASSWORD', 'ないしょ' );
define( 'DB_HOST',     '192.168.56.108' );
define( 'DB_CHARSET',  'utf8' );
define( 'DB_COLLATE', '' );

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

$table_prefix = 'wp_';

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', 'c:/inetpub/wwwroot/wp/wp_errors.log' );

/* カスタム値は、この行と「編集が必要なのはここまでです」の行の間に追加してください。 */

/* 編集が必要なのはここまで ! WordPress でのパブリッシングをお楽しみください。*/

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', __DIR__ . '/' );
}

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

step 5 - access install.php

後は、ブラウザで install.php へ、アクセスし、少々、設定すれば、完了です

http://localhost/wp/wp-admin/install.php