本日、UseBBをスターサーバーのフリープランにインストールしていました。しかし、日本語化にしようとprofile.php?id=1にアクセスしたところエラーが出てしまい全く知らない領域に手も足も出なかったため質問させていただきました。
環境
サーバー - スターサーバー無料プラン PHP(公式のテスト環境と合わせるため5.5.38)とMySQL(5.7.x)が使えるやつ
UseBB - 1.0.16(2は情報が少なかったので...)
FTPソフト - Filezillaの最新版
インストール前に行ったこと
config.php-distの-distを削除
エラーメッセージ
in file sources/db_mysqli.php on line 96:
SQL_ERROR - Access denied for user -filtered-(using password: YES)
### 問題のソースコード
PHP
1<?php 2 3/* 4 Copyright (C) 2003-2012 UseBB Team 5 http://www.usebb.net 6 7 $Id$ 8 9 This file is part of UseBB. 10 11 UseBB is free software; you can redistribute it and/or modify 12 it under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2 of the License, or 14 (at your option) any later version. 15 16 UseBB is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with UseBB; if not, write to the Free Software 23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24*/ 25 26/** 27 * MySQLi database driver 28 * 29 * Contains the db class for MySQLi handling. 30 * 31 * @author UseBB Team 32 * @link http://www.usebb.net 33 * @license GPL-2 34 * @version $Revision$ 35 * @copyright Copyright (C) 2003-2012 UseBB Team 36 * @package UseBB 37 * @subpackage Core 38 */ 39 40// 41// Die when called directly in browser 42// 43if ( !defined('INCLUDED') ) 44 exit(); 45 46if ( !extension_loaded('mysqli') && !defined('NO_DB') ) 47 trigger_error('Unable to load module for database server "mysqli": PHP mysqli extension not available!', E_USER_ERROR); 48 49ini_set('mysql.trace_mode', '0'); 50 51/** 52 * MySQLi database driver 53 * 54 * Performs database handling for MySQLi. 55 * 56 * @author UseBB Team 57 * @link http://www.usebb.net 58 * @license GPL-2 59 * @version $Revision$ 60 * @copyright Copyright (C) 2003-2012 UseBB Team 61 * @package UseBB 62 * @subpackage Core 63 */ 64class db { 65 66 /**#@+ 67 * @access private 68 */ 69 var $connection; 70 var $queries = array(); 71 var $persistent; 72 /**#@-*/ 73 74 /** 75 * Make a connection to the MySQL server 76 * 77 * @param array $config Database configuration 78 */ 79 function connect($config) { 80 81 global $functions; 82 83 if ( defined('NO_DB') ) 84 return; 85 86 // 87 // mysqli persistent only for 5.3.0+ 88 // 89 $this->persistent = ( $config['persistent'] && version_compare(PHP_VERSION, '5.3.0', '>=') ); 90 if ( $this->persistent ) 91 $config['server'] = 'p:'.$config['server']; 92 93 // 94 // Connect to server 95 // 96 $this->connection = @mysqli_connect($config['server'], $config['username'], $config['passwd']) or trigger_error('SQL: '.mysqli_connect_error(), E_USER_ERROR); 97 98 // 99 // Select database 100 // 101 @mysqli_select_db($this->connection, $config['dbname']) or trigger_error('SQL: '.mysqli_error($this->connection), E_USER_ERROR); 102 103 // 104 // Set transaction to latin1 105 // 106 if ( is_object($functions) && $functions->get_config('force_latin1_db', true) ) 107 $this->query("SET NAMES latin1", true, false); 108 109 } 110 111 /** 112 * Execute database queries 113 * 114 * @param string $query SQL query 115 * @param bool $return_error Return error instead of giving general error 116 * @returns mixed SQL result resource or SQL error (only when $return_error is true) 117 */ 118 function query($query, $return_error=false, $log=true) { 119 120 if ( $log ) 121 $this->queries[] = preg_replace('#\s+#', ' ', $query); 122 123 $result = @mysqli_query($this->connection, $query) or $error = mysqli_error($this->connection); 124 125 if ( isset($error) ) { 126 127 if ( $return_error ) 128 return $error; 129 else 130 trigger_error('SQL: '.$error, E_USER_ERROR); 131 132 } 133 134 return $result; 135 136 } 137 138 /** 139 * Fetch query results 140 * 141 * @param resource $result SQL query resource 142 * @returns array Array containing one result 143 */ 144 function fetch_result(&$result) { 145 146 $res_array = mysqli_fetch_array($result, MYSQLI_ASSOC); 147 148 if ( is_array($res_array) ) { 149 150 array_walk($res_array, 'usebb_clean_db_value'); 151 reset($res_array); 152 153 } 154 155 return $res_array; 156 157 } 158 159 /** 160 * Count row number 161 * 162 * @param resource $result SQL query resource 163 * @returns int Number of result rows 164 */ 165 function num_rows(&$result) { 166 167 return mysqli_num_rows($result); 168 169 } 170 171 /** 172 * Last inserted ID 173 * 174 * @returns int Last inserted auto increment ID 175 */ 176 function last_id() { 177 178 return mysqli_insert_id($this->connection); 179 180 } 181 182 /** 183 * Get used queries array 184 * 185 * @returns array Array containing executed queries 186 */ 187 function get_used_queries() { 188 189 return $this->queries; 190 191 } 192 193 /** 194 * Get server version info 195 * 196 * @returns array Array containing database driver info and server version 197 */ 198 function get_server_info() { 199 200 return array( 201 'MySQL (mysqli)', 202 mysqli_get_server_info($this->connection) 203 ); 204 205 } 206 207 /** 208 * Disconnect the database connection 209 */ 210 function disconnect() { 211 212 if ( !$this->persistent ) 213 @mysqli_close($this->connection); 214 215 } 216 217} 218 219?> 220
試したこと
PHPを5.1.6,5.3.3,5.4.16,5.5.38,5.6.30,7.0.18,7.1.4に変更して実行
キャッシュの破棄
再インストール