So I followed the tutorial provided by heroku on how to deploy a php app https://devcenter.heroku.com/articles/getting-started-with-php#introduction
Everything works fine, except when I get to setting up the database. At first I tried looking for different solutions online (i.e. Dokku deployed Silex can't find PdoServiceProvider), but not seens to work.
Right now, my code looks like this:
<?php
use Csanquer\Silex\PdoServiceProvider\Provider\PDOServiceProvider;
//use Silex\Application;
$dbopts = parse_url(getenv('DATABASE_URL'));
$pdo = new PDOServiceProvider('pdo');
//$app = new Application();
$app->register($pdo,
array(
'pdo.server' => array(
'driver' => 'pgsql',
'user' => $dbopts["user"],
'password' => $dbopts["pass"],
'host' => $dbopts["host"],
'port' => $dbopts["port"],
'dbname' => ltrim($dbopts["path"],'/')
)
)
);
?>
And I get the following message:
Uncaught Error: Class 'Csanquer\Silex\PdoServiceProvider\Provider\PDOServiceProvider' not found in /app/web/index.php:6
How can I fix it?