我想部署一些php项目到heroku。我用具有所需依赖性的作曲家是slim framework
和simple_http_dom
。我composer.json
这里的内容:PHP Heroku - 调用未定义的函数mb_detect_encoding()
{
"require": {
"slim/slim": "2.4.3",
"shark/simple_html_dom": "dev-master"
}
}
,当我在本地运行这个程序,它的工作就像一个魅力。
我的应用成功推向了heroku。当我尝试从浏览器访问它时发生问题。它什么也没有显示。这里是我从heroku logs
命令得到的错误的一些线索。
2014-08-31T00:14:38.052441+00:00 app[web.1]: [Sun Aug 31 00:14:37.566291 2014] [proxy_fcgi:error] [pid 60:tid 140467698300672] [client 10.2.162.208:58783] AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234\n', referer: http://myapp.herokuapp.com/index.php/scrap/all
2014-08-31T00:14:38.052437+00:00 app[web.1]: 10.2.162.208 - - [31/Aug/2014:00:14:37 +0000] "POST /index.php/scrap/all/do HTTP/1.1" 500 - "http://myapp.herokuapp.com/index.php/scrap/all" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
2014-08-31T00:14:38.052443+00:00 app[web.1]: [31-Aug-2014 00:14:37] WARNING: [pool www] child 58 said into stderr: "NOTICE: PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234"
它说:
Got error 'PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234\n', referer: http://myapp.herokuapp.com/index.php/scrap/all
这是我第一次得到这个错误。我有另一个项目使用相同的依赖关系(但没有作曲家)在heroku上运行,并且工作顺利。
我该怎么办才能解决这个问题?
不是。那个问题很老,答案也是如此。它不适用了。 – dzuelke 2014-09-02 21:11:24