Heroku更新后的Mongo php扩展(作曲家) [英] Mongo php extension after Heroku update (composer)

查看:149
本文介绍了Heroku更新后的Mongo php扩展(作曲家)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Heroku 发送给我一封关于所需更新的电子邮件时,发生了问题适用于 PHP 应用的作曲家



目前我的文件夹:

   -  MyProject / 
------ ext /
---------- mongo .so
------ php.ini
------ composer.json
------ index.php
Composer )。



$ b

b $ b

php.ini

  extension_dir =/ app / www / ext / 
extension = mongo.so

composer.json

  {
require:{
ext-mongo:*
}
}

显然,如果我运行安装命令,我得到错误:

  $作曲者安装

问题1
- 请求的PHP扩展ext-mongo *在系统中缺失。

index.php

 <?php 
$ connection = new Mongo(mongodb:// username:password@ds053728.mongolab.com:53728 / dbname);
$ db = $ connection-> dbname;
回声完成?;
?>

Heroku显然不再识别 php.ini 设置和 ext / mongo.so ,所以我得到像 Mongo Class 这样的错误。



我也不确定如何使用 composer 添加扩展名( ext -.... ),它们不会出现在 https://packagist.org/



我找不到包含此信息的解决方案: https://devcenter.heroku.com/articles/php-support#extensions


现在支持 mongo 扩展名: https://devcenter.heroku.com/changelog-items/467
- 无需自定义buildpacks。


I have days trying everything and looking everywhere the solution.

The problem happened when Heroku sent me an email about an update which required Composer for PHP aplications.

My folder currently:

-- MyProject/
------ ext/
---------- mongo.so
------ php.ini
------ composer.json
------ index.php

(Before the problem, this running perfect of course without Composer).

php.ini

extension_dir = "/app/www/ext/"
extension=mongo.so

composer.json

{
  "require": {
    "ext-mongo": "*"
  }
}

Obviously if I run the install command, I get error:

$ composer install

  Problem 1
     - The requested PHP extension ext-mongo * is missing from your system.

index.php

<?php
$connection = new Mongo("mongodb://username:password@ds053728.mongolab.com:53728/dbname");
$db = $connection->dbname;
echo "done?";
?>

Heroku apparently no longer recognizes the php.ini settings and ext/mongo.so, so I get errors like Mongo Class not found.

I'm also not sure how to add the extensions ("ext-....") with composer that do not appear in https://packagist.org/

I can't find the solution with this information: https://devcenter.heroku.com/articles/php-support#extensions

解决方案

The mongo extension is now supported: https://devcenter.heroku.com/changelog-items/467 - no need for custom buildpacks.

这篇关于Heroku更新后的Mongo php扩展(作曲家)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆