We’ve had some trouble recently firing up a Droplet on Digital Ocean and upgrading PHP to 5.5.13 when using Symfony’s FOSUserBundle with Sylius and Sonata E-Commerce frameworks. The problem arises when you want to log into the administration areas of these E-Commerce systems. The FOSUserBundle allows a user to be authenticated, however the firewall used within the framework attempts to serialise some data which doesn’t quite work.

Using the exact same code base we setup a 3 VMs using Vagrant of the hardworking hashicorp/precise64 Ubuntu box. Each VM had PHP versions, 5.3.10, 5.4.29 and 5.5.13.

We found that PHP5.3.10 worked perfectly and PHP5.4.29 and PHP5.5.13 shows this within the Symfony logs

[2014-06-20 09:27:05] security.INFO: User "admin" has been authenticated successfully [] []
 [2014-06-20 09:27:05] doctrine.DEBUG: "START TRANSACTION" [] []
 [2014-06-20 09:27:05] doctrine.DEBUG: UPDATE fos_user_user SET last_login = ?, updated_at = ? WHERE id = ? ["2014-06-20 09:27:05","2014-06-20 09:27:05",1] []
 [2014-06-20 09:27:05] doctrine.DEBUG: INSERT INTO revisions (timestamp, username) VALUES (?, ?) ["2014-06-20 09:27:05","(binary value)"] []
 [2014-06-20 09:27:05] doctrine.DEBUG: INSERT INTO fos_user_user_audit (rev, revtype, 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, created_at, updated_at, date_of_birth, firstname, lastname, website, biography, gender, locale, timezone, phone, facebook_uid, facebook_name, facebook_data, twitter_uid, twitter_name, twitter_data, gplus_uid, gplus_name, gplus_data, token, two_step_code, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ["1178","UPD","admin","admin","verla.predovic@example.com","verla.predovic@example.com",true,"n2gp2h6w6uookog8kw4k4oww88ogcwg","23a6bd09fd11727cf2f7c7a340 [...]","2014-06-20 09:27:05",false,false,null,null,null,["ROLE_SUPER_ADMIN","ROLE_SONATA_ADMIN"],false,null,"2014-06-19 21:54:29","2014-06-20 09:27:05",null,null,null,null,null,"u",null,null,null,null,null,null,null,null,null,null,null,null,null,null,1] []
 [2014-06-20 09:27:05] doctrine.DEBUG: "COMMIT" [] []
 [2014-06-20 09:27:05] event.DEBUG: Listener "Symfony\Component\Security\Http\Firewall::onKernelRequest" stopped propagation of the event "kernel.request". [] []

We are not fully sure yet, but after reading this http://www.serverphorums.com/read.php?7,946926 we have our doubts on whether the serialisation on PHP is involved causing the firewall in Symfony to break.

If you have a similar experience please get in touch, our quest continues…

UPDATE

We’ve just installed¬†PHP 5.5.9-1ubuntu4 and Symfony, Sonata now work! Will be testing Sylius shortly.