官方文档
Using optional extensions
You may declare any optional extensions you want to use via composer.json using Composer Platform Packages; simply prefix any of the identifiers in the list of extensions above with “ext-” in the package name.
{
"require": {
"ext-bcmath": "*",
"ext-mcrypt": "*",
"ext-memcached": "*",
"ext-mongodb": "^1.1.0"
}
}
It is recommended that you use “*” as the version selector when specifying extensions that are bundled with PHP, as their version numbers can be highly inconsistent (they often report their version as “0”).
动手操作
heroku作为一个仓库,是没有办法像本地环境那样直接加载加载mbstring.so文件的,需要使用composer加载扩展。
直接在composer.json中加载添加扩展就好了
{
"require":{
"ext-mbstring":"*"
}
}
需要注意的是,要现在本地生成composer.lock文件,才能正常上传代码。
/app: composer install