前提・実現したいこと
「Amazon Web Services 基礎からのネットワーク&サーバー構築」という書籍に沿って、
AWS上でWordPressの環境構築にトライしています。
書籍の通り、DBサーバーとWebサーバーのインスタンスは分かれており、DBサーバーはプライベートアドレスのみで、
今回WordPressをブラウザで開いて初期設定を行う段階でハマってしまったので、質問させていただきたく思います。
発生している問題・エラーメッセージ
あらかたWebサーバー・DBサーバーのインスタンス作成・設定が済み、
Apatch + MySQL + PHP + WordPressのインストールまで完了して、いざブラウザからWordPressの初期設定(インストール)をしようとすると、
「データベース接続確立エラー」という画面に遷移してしまいます。
試したこと
初期設定画面(setup-config.php)での「データベース名」、「ユーザー名」、「パスワード」、「ホスト名」に間違いはありません。「ホスト名」にはDBサーバーのプライベートIPアドレス「10.0.2.0」を割り当てています。因みにwp-config.phpファイルはまだ生成されていないようでした。
※追記:DBサーバーのプライベートアドレス「10.0.2.10」でした。。大変失礼致しました。。。
Webサーバーにssh接続して「mysql -h (ホスト名) -u (ユーザー名) -p (パスワード)」とすると問題なく接続ができます。
MySQLの権限設定の問題かと思い、データベース接続後にテーブル作成や削除等の操作をしてみましたが問題なく実行できました。
なにが原因かよくわからず、作業ができない状況になっています。
もし原因が特定できそうな方がいらっしゃいましたら、何卒お力添えをお願いしたく思います。
補足情報(FW/ツールのバージョンなど)
OS: Amazon Linux 2 AMI (HVM)
Apache:2.4.34
MySQL: 8.0.12
PHP: 5.4.16 (Zend Engine v2.4.0)
不足情報等あればすぐに追記いたします。
何卒どうかよろしくお願い致します。
10/29追記
php -iで出てくる情報
/etc/php.d/mysqlnd.ini, /etc/php.d/mysqlnd_mysql.ini, /etc/php.d/mysqlnd_mysqli.ini, /etc/php.d/pdo_mysqlnd.ini, PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0 mysql Client API version => mysqlnd 5.0.10 - 20111026 - $Id: ●●●● $ mysql.allow_local_infile => On => On mysql.allow_persistent => On => On mysql.connect_timeout => 60 => 60 mysql.default_host => no value => no value mysql.default_password => no value => no value mysql.default_port => no value => no value mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock mysql.default_user => no value => no value mysql.max_links => Unlimited => Unlimited mysql.max_persistent => Unlimited => Unlimited mysql.trace_mode => Off => Off mysqli Client API library version => mysqlnd 5.0.10 - 20111026 - $Id: ●●●● $ mysqli.allow_local_infile => On => On mysqli.allow_persistent => On => On mysqli.default_host => no value => no value mysqli.default_port => 3306 => 3306 mysqli.default_pw => no value => no value mysqli.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock mysqli.default_user => no value => no value mysqli.max_links => Unlimited => Unlimited mysqli.max_persistent => Unlimited => Unlimited mysqli.reconnect => Off => Off mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $ Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password API Extensions => mysql,mysqli,pdo_mysql mysqlnd statistics => PDO drivers => mysql, sqlite pdo_mysql Client API version => mysqlnd 5.0.10 - 20111026 - $Id: ●●●● $
/var/log/httpd/error_logの内容
[Sun Oct 28 03:11:02.081931 2018] [lbmethod_heartbeat:notice] [pid 11679] AH02282: No slotmem from mod_heartmonitor [Sun Oct 28 03:11:02.082011 2018] [http2:warn] [pid 11679] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive. [Sun Oct 28 03:11:02.082017 2018] [http2:warn] [pid 11679] AH02951: mod_ssl does not seem to be enabled [Sun Oct 28 03:11:02.094453 2018] [mpm_prefork:notice] [pid 11679] AH00163: Apache/2.4.34 () PHP/5.4.16 configured -- resuming normal operations [Sun Oct 28 03:11:02.094465 2018] [core:notice] [pid 11679] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Sun Oct 28 18:17:00.142714 2018] [cgi:error] [pid 14709] [client 50.232.243.66:62110] AH02811: script not found or unable to stat: /var/www/cgi-bin/getinfo pdo_mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
10/30追記
wp-content/debug.logの内容
[29-Oct-2018 16:42:02 UTC] PHP Warning: mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in /var/www/html/wp-includes/wp-db.php on line 1531 [29-Oct-2018 16:42:02 UTC] PHP Warning: mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers in /var/www/html/wp-includes/wp-db.php on line 1531 [29-Oct-2018 16:42:02 UTC] PHP Warning: mysql_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in /var/www/html/wp-includes/wp-db.php on line 1562 [29-Oct-2018 16:42:02 UTC] PHP Warning: mysql_connect(): Server sent charset unknown to the client. Please, report to the developers in /var/www/html/wp-includes/wp-db.php on line 1562
my.cnfの内容
[mysqld] # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove the leading "# " to disable binary logging # Binary logging captures changes between backups and is enabled by # default. It's default setting is log_bin=binlog # disable_log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M # # Remove leading # to revert to previous value for default_authentication_plugin, # this will increase compatibility with older clients. For background, see: # https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin # default-authentication-plugin=mysql_native_password datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid collation-server = utf8mb4_general_ci character-set-server = utf8mb4 [client] default-character-set = utf8mb4
回答3件
あなたの回答
tips
プレビュー