dongyuduan1890 2015-12-14 18:35
浏览 23

PHP新的PDO连接问题

I run a game forum and associated game server. For the last 2 years, users signed up on the forums, which had their name/password then passed to my game servers database. Once they completed registration, another call was made that flipped a flag in the game database to allow them to play.

At some point, this process stopped working and all new forum accounts (phpbb forums) simply never made their way to my games SQL servers. I've opened up my SQL monitor on my game server and no connection is ever made using the credentials that have been passed. I also get no error listed when a new account is created. Code below:

// Create game account

try {
$acctConnection = new PDO('mysql:dbname=DB_Redacted;host=x.x.x.x;port=33306;charset=utf8','DB_forum','PasswordHere', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$acctStmt = $acctConnection->prepare('CALL forum_link(?,?)');
$acctStmt->bindParam(1, $newname);
$acctStmt->bindParam(2, $plainpassword);
$acctStmt->execute();
$acctConnection = NULL;
} catch (PDOException $e) {
echo 'Creating game account failed';
}

forum_link is the stored procedure used to insert the values in to the game database. The account is also setup to only accept connections from my dedicated IP forum host, which the IP has not changed and also to be able to run the stored procedure listed. Game server is listening on the listed port and I've even tested with no firewall running. I'm fairly new to this as the process was setup by another dev who no longer works on the project but was seemingly working without fail for a long time. Any ideas what may be wrong and/or how I can get more robust logging in place to catch what the issue may be?

  • 写回答

1条回答 默认 最新

  • duanche9384 2016-01-21 16:30
    关注

    This ended up being an issue where the PDO function was corrupt/missing due to Java being corrupt on the webserver. This was due to a hosting issue. I reset this by selecting a new (updated) java version to be used in CPANEL, which reinstalled the PDO module and my connections to the other SQL server then had no problems. I needed to add additional error logging to my PDO statement to catch this as being the issue, which I found how to do via some webdevs elsewhere.

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题