スポンサーリンク

PHP7のmysqli_connectがエラー

スポンサーリンク

本ブログがまた閲覧不可になっていました。閲覧不可どころか、管理画面のログインすら失敗する状況でした。
DBがぶっ壊れたか~と慌てましたが、経過は省略して結論から言いますと、PHP7のmysqli_connect()の仕様変更でした。
db_mysql.phpの以下の記述変更で直りました。

//$__gb_sql_connect = @mysqli_connect(BLOGN_DB_HOST.”:”.BLOGN_DB_PORT, BLOGN_DB_USER, BLOGN_DB_PASS);
$__gb_sql_connect = @mysqli_connect(BLOGN_DB_HOST, BLOGN_DB_USER, BLOGN_DB_PASS, BLOGN_DB_NAME, intval(BLOGN_DB_PORT));

・DB名が必須になった
・ポート番号を指定する場合、ホスト名にコロン(:)で連結はできなくなり、オプションパラメータで設定するようになった
ようです。

コメント

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny

タイトルとURLをコピーしました