FOSFacebookBundleとFOSUserBundleとSymfony2を使用してユーザーを管理しています。ローカルですべてが正常に機能しました。ただし、すべてをステージング環境にプッシュすると、登録時にユーザーが(ドクトリンエンティティマネージャーを使用して)永続化されていないことに気付きました。
私が最初にチェックしたのは、エンティティマネージャーを使用して他のものを永続化できるかどうかでした。これはうまくいきました。次に、ログを確認して、挿入ステートメントが存在することを確認しました。
INSERT INTO user (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expired, expires_at, confirmation_token, password_requested_at, roles, credentials_expired, credentials_expire_at, firstname, lastname, facebookID, date_of_birth, locale, gender, has_profile_pic, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
({"1":"1234","2":"1234","3":"foo@gmail.com","4":"foo@gmail.com","5":true,"6":"","7":"","8":null,"9":0,"10":false,"11":null,"12":null,"13":null,"14":["ROLE_FACEBOOK"],"15":0,"16":null,"17":"Mr","18":"Foo","19":"1234","20":{"date":"1986-12-09 00:00:00","timezone_type":3,"timezone":"PRC"},"21":"nl_NL","22":"male","23":1,"24":{"date":"2012-07-06 01:34:47","timezone_type":3,"timezone":"PRC"},"25":{"date":"2012-07-06 01:34:47","timezone_type":3,"timezone":"PRC"}})
疑問符をプリペアドステートメントの値に置き換えて手動でクエリを発行すると、すべてが正常に機能します。
誰かがこれが何であるかについて何か手がかりを得ましたか?次にどこを見ればよいかわからないので、これをさらにデバッグする方法のヒントにも非常に満足しています。
前もって感謝します!
アップデート:
mysqlログをもう一度見てみると、INSERTステートメントが準備されているが、実行されていないことに気付きました(selectステートメントとは異なります)。エラーログにエラーが見つかりません。mysqlログは次のとおりです。
34 Prepare SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.firstname AS firstname18, t0.lastname AS lastname19, t0.facebookID AS facebookID20, t0.date_of_birth AS date_of_birth21, t0.locale AS locale22, t0.gender AS gender23, t0.has_profile_pic AS has_profile_pic24, t0.created_at AS created_at25, t0.updated_at AS updated_at26 FROM user t0 WHERE t0.facebookID = ?
34 Execute SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.firstname AS firstname18, t0.lastname AS lastname19, t0.facebookID AS facebookID20, t0.date_of_birth AS date_of_birth21, t0.locale AS locale22, t0.gender AS gender23, t0.has_profile_pic AS has_profile_pic24, t0.created_at AS created_at25, t0.updated_at AS updated_at26 FROM user t0 WHERE t0.facebookID = '1234'
34 Close stmt
34 Query START TRANSACTION
34 Prepare INSERT INTO user (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expired, expires_at, confirmation_token, password_requested_at, roles, credentials_expired, credentials_expire_at, firstname, lastname, facebookID, date_of_birth, locale, gender, has_profile_pic, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
34 Close stmt
34 Query COMMIT
34 Quit
手がかりはありますか?
更新2:
PDOステートメントの実行のいくつかの戻り値をdoctrinelibに記録してきましたが、開発環境で通常の戻り値(1)を取得していることがわかりました。ただし、実稼働環境では戻り値が得られません。別のヒントのようですが、どうすればよいかわかりません。
ちなみにPDOStatement::errorCode
00000を返します(すべてがうまくいったことを示します)