0

The problem is that when I open the facebook canvas. I get this error. "call to undefined function mb_substr"

enter image description here

The solution that most people suggest is to put "ext-mbstring" as a require. I did that in different way's. This is what I have now:

{
  "require" : {
    "silex/silex": "~1.3",
    "monolog/monolog": "~1.7",
    "twig/twig": "^1.19",
    "symfony/twig-bridge": "^2.7"
  },
  "require-dev": {
    "heroku/heroku-buildpack-php": "*"
  },
    "require": {
    "ext-mbstring": "*"
}
}

This does not work for me. I have also checked the php info of my heroku server. This is the output. As you can see the mbstring is set. enter image description here

What I at last think the problem could be is the php version. Facebook wants a version that's higher than 5.4. I am using version 5.6.15. So that shouldn't be the problem either.

Anyone knows what I missed?

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • "--enable_...=shared" means that the extension module was compiled as a shared object/dll when the php core was build. It tells you nothing about whether the module is actually available or not. – VolkerK Nov 08 '15 at 13:48

2 Answers2

0

Since it's a JSON object and require is the property key, I don't think you can just add a second property with the same key. Try to add the dependency to the first require property.

{
  "require" : {
    "php": ">=5.6.0",
    "ext-mbstring": "*",
    "silex/silex": "~1.3",
    "monolog/monolog": "~1.7",
    "twig/twig": "^1.19",
    "symfony/twig-bridge": "^2.7"
  },
  ...
VolkerK
  • 95,432
  • 20
  • 163
  • 226
0

Don't forget to run composer update after you make changes to composer.json.

kkmah7
  • 19
  • 4