Mongo php extension after Heroku update (composer)

血红的双手。 提交于 2019-12-08 12:25:11

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/23450396/mongo-php-extension-after-heroku-update-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!