Last Updated: February 25, 2016
· captn3m0

How to use mbstring on Heroku (PHP)

I recently wanted to use the mbstring extension on Heroku default PHP buildpack, and was unable to find a simple working solution. There were lots of buildpacks which offered mbstring support, but I found a much cleaner solution:

Add the following line in your composer.json:

"require": {
  "ext-mbstring": "*"

And heroku will automatically add the mbstring extension to your app on the next deploy.

Say Thanks

3 Responses
Add your response

Wobf8txr normal

Thank you man, I've looking for a solution too. This is so helpful!

over 1 year ago ·

thanks !

over 1 year ago ·
Gh7ouvhh normal

this has been so difficult to figure out because it works fine on local development using Mamp. The wordpress-heroku template didn't include a composer.json file so I wasn't sure this would work. I read seriously 50 different ideas of what could be the problem, nothing was working. This is the correct answer for anyone having an issue with visual composer with their theme of choice. mine being the ken theme. Thank you!

over 1 year ago ·