PHP Session Handling on Heroku

Most web applications use sessions of some kind for things like login systems, authentication, flash messages, etc. But using them on cloud services like Heroku can sometimes be a hastle. This post will hopefully outline some of the different methods you can use to get a fast, adaptable and easy session handler with PHP. Option 1) Single Dyno, Default Session (File) By simply running session_start(); with PHP, by default a file based session will start. This is great because it’s … Continued


Direct Upload to S3 (with PHP & Composer)

This is a continuation in the ‘Direct Upload‘ series: First we began with a look at how you can directly upload a file to s3, talking it through in detail (13/10/2013). We later made another post, explaining how to handle multiple files and updating the code to use AWS’s signature V4 (7/3/2015). Now we’re back with another improvement! Instead of the copy and paste from a blog post solution we were advocating in past blog posts, we’ve now built a … Continued


Dedicated vs. Shared Databases: A ‘MySQL has gone way’ fix

While working on a data heavy web application recently we noticed some strange unstable performance with our SQL database – this is a post about how we investigated it and what we did about it. The application was written in PHP and hosted on Heroku in the EU region. We were using a ClearDB database, also hosted in the EU. TL;DR Our ‘MySQL server has gone away‘ message was fixed by moving from a shared database to a dedicated database … Continued


HHVM, Laravel & Heroku – The Killer Combination

Laying the foundations to a new project recently, some new web technologies were considered for use, notable among these was the recent announcement of Facebook’s HHVM engine and HACK language, which is now gaining support and stability. The project itself was going to be run on Heroku, a cloud PaaS (Platform as a Service) which allows websites to scale dynamically as they grow. Aside from what the software was going to run on, the software itself was going to be … Continued