MySQLi and Heroku

If you liked this post, say thanks by sharing it:

The following is an account of my experience with Heroku and mysqli.

During my search for platform to deploy an app on for a recent project I was working on, I thought of heroku. Heroku is a platform that is best described by them:

“Agile deployment for Ruby, Node.js, Clojure, Java, Python, and Scala.

Get up and running in minutes, and deploy instantly with git. Focus 100% on your code, and never think about servers, instances, or VMs again.”

Heroku Screenshot

I typically develop in php since that is what I am used to and have done so for years. Its my strongest language and what I am comfortable writing. Recently on a go-live of another project, a client had the newest version of php and mysql installed, making for some unwanted headaches. Much to my surprise, and not anywhere in the release notes for that version, which I try to keep up with, the mysql extension that I had typically used, had been deprecated as of php 5.5.0. No worries, I worked with my client to switch out my mysql statements for that of mysqli, as it is the new standard along with pdo for database connections in php. After this fiasco, I decided to start developing exclusively with the new mysqli extension as it seemed to be the new norm and had had no issues until now.

There is just a small problem when it comes to the application I developed and my wanting to run it on heroku… no support for mysqli. It’s been in the php core since 5.0.0, accessible without mod since 5.3.0, and the new default in 5.5.0. So why does heroku not support this extension? I posed this question to support.

Heroku Support Screenshot

In typical heroku fashion, they were very quick to respond, which I appreciate. Since they were acquired by salesforce, and have been chosen by facebook to run many of their applications, I have been very impressed that heroku service still stays responsive to the little guys. Neil responded quickly with a suggestion that I be: “keeping an eye on our blog”.

I decided to go with Amazon Web Services and use elastic beanstalk to run my app. I really don’t care about the infrastructure behind it, the elastic load balancer, cloudwatch, ec2, rds, and all the other acronyms that go into making my app run. Really, I care about uptime and backups which was why I was excited about heroku.

Unfortunately, until heroku starts supporting mysqli, I will stick with the little more complicated elastic beanstalk to run my php apps…

When will heroku support mysqli?


***Edit: Please view the new article, Round 2, on how to get MySQLi running on Heroku Cedar even though it is not natively supported by the default buildpack.

If you liked this post, say thanks by sharing it:
Tagged with: , , ,
Posted in Heroku
3 comments on “MySQLi and Heroku
  1. Byron says:

    From what I understand is you need to create a custom build-pack for your heroku setup, doing so allows you to install any php extensions or any other software you might need on your dyno.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>