1

I have my Facebook app running without any problem in my localhost. But when I hosted it in Heroku, I got these problems.

The problem is when the user gets redirected from Facebook after login and permissions it shows blank page, and in Heroku logs it shows:

"NOTICE: PHP message: PHP Fatal error: Call to undefined function Facebook\HttpClients\mb_strlen() in /app/facebook/facebook- sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 300"

I think the error is in mb_strlen() function. I do not know how to rectify it.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • I suspect you'll need to enable the `mbstring` module? See here: http://php.net/manual/en/book.mbstring.php – halfer Aug 10 '14 at 17:08
  • Actually, Thats the problem...I do no how to enable mbstring in heroku...i can do it in my localhost – SreBalaji Thirumalai Aug 11 '14 at 14:12
  • [This search](https://duckduckgo.com/?q=enable+mbstring+in+heroku) gave me [this Heroku article](https://devcenter.heroku.com/articles/php-support) - search for 'The following built-in extensions have been built “shared”'. – halfer Aug 11 '14 at 14:15

1 Answers1

3

The mbstring extension can be turned on in Heroku using Composer. Just use the mbstring dependency and Heroku will do the rest.

I expect it would look something like this:

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

Of course, if you have other requires at present, you should add this to them, not replace them.

Here's the documentation you need.

halfer
  • 19,824
  • 17
  • 99
  • 186