问题描述
有人知道如何安装PHP扩展:Heroku的多字节字符串: http://php.net/manual/zh/book.mbstring.php
Does anybody know how to install the PHP Extension: Multibyte String for Heroku:http://php.net/manual/en/book.mbstring.php
这是我为Heroku安装Mongo的方式:
Here is how I installed Mongo for Heroku:
https://gist.github.com/1288447
一切都很好,但是我找不到编译mbstring.so
文件的源.
All is well, but I cannot find the source for compiling the mbstring.so
file.
任何指导将不胜感激.
推荐答案
获取Heroku扩展名的首选方法是使用composer.json. mbstring是Heroku根据 https://devcenter提供的预编译和共享的扩展之一.heroku.com/articles/php-support#extensions
The preferred way of getting extensions for Heroku would be to use composer.json. mbstring is one of the extensions that Heroku provides pre-compiled and shared according to https://devcenter.heroku.com/articles/php-support#extensions
要使用它,您所要做的就是在项目的根目录中创建一个composer.json文件(如果您还没有),其内容如下:
To use it, all you have to do is create a composer.json file (if you don't already have one) in the root of your project with the following contents:
{
"require": {
"ext-mbstring": "*"
}
}
无需编译您自己的mbstring扩展名或从其他地方获取已编译的版本.
There is no need to compile your own mbstring extension or grab a compiled version from somewhere else.
作为旁注,也不再需要自己编译MongoDB扩展.它也在Heroku提供的扩展名列表中,您可以让composer.json文件同时执行这两个操作,如下所示:
As a side note, there's also no longer a need to compile the MongoDB extension yourself, either. It's also on the list of Heroku-provided extensions and you could have a composer.json file do both, like this:
{
"require": {
"ext-mbstring": "*",
"ext-mongo": "*"
}
}
这篇关于Heroku上的PHP多字节字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!