简体   繁体   中英

Mongo php extension after Heroku update (composer)

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM