• Blog
  • Projects
  • search
  • contact
  • The most recent blog articles - mostly about PHP, Golang, databases or general website dev ops.


  • Running Laravel Migrations on Heroku

    Migrations are a really handy was of making database changes, be it schema or data, and keeping it in sync across multiple locations. They are however much more useful when automatic, so when they are needed to be run, they run. This helps prevent errors when you forget to run the migrations for instance. When using platforms like Heroku and tools like Composer, this becomes very easy. All that’s needed is to add the php artisan migrate --force command (–force is needed because they are run on the production) into the post-install-cmd section of your composer.json. Your entire scripts section will look something like the following:
  • 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 Composer package instead. With all the improvements we’ve made to the script over time it seemed a shame that it wasn’t easy for users to update and maintain (because we weren’t using a package manager).
  • 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 structure (among other things) – and not by any code changes. The Problem Occasionally we noticed our web application would have a performance spike for seemingly no reason at all causing Heroku to throw a H12 timeout error and an error message to our users. This would happen roughly once a week. Checking the logs, we could see that it was a problem connecting to our database, the exact message showing up was a ‘MySQL server has gone away’ – something we became familiar with over time.
  • Super-charge your WordPress Blog: Setup a CDN

    Performance is important. We get this. As blog owners if our users get frustrated then we get frustrated. In this post we’ll look at how you can move a blog’s performance and loading times to the next level. A couple of years ago we looked at how to improve a website’s loading times – this post should be more specific than that, focusing primarily on WordPress and how content is delivered to your users.
  • php (19)
  • javascript (13)
  • css (12)
  • http (8)
  • jquery (8)
  • function (7)
  • aws (6)
  • code (6)
  • html5 (6)
  • html (5)
  • laravel (5)
  • wordpress (5)
  • api (4)
  • css3 (4)
  • fallback (4)
  • framework (4)
  • heroku (4)
  • js (4)
  • new (4)
  • performance (4)
  • server (4)
  • update (4)
  • array (3)
  • async (3)
  • class (3)
  • go (3)
  • htaccess (3)
  • install (3)
  • mobile (3)
  • mysql (3)
  • new-version (3)
  • open-source (3)
  • policy (3)
  • prefix (3)
  • s3 (3)
  • signature (3)
  • sql (3)
  • theme (3)
  • tutorial (3)
  • web (3)