I am trying to add Doctrine to existing custom php application. The first issue that I've faced is the following:
when trying to run
$ php vendor/bin/doctrine orm:schema-tool:create
I get Access denied
.
Here is the cli-config.php file that I am using:
<?php
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Setup;
require_once "vendor/autoload.php";
$modelsPath = realpath(__DIR__.'/../model');
$config = Setup::createAnnotationMetadataConfiguration(array($modelsPath), true);
// database configuration parameters
$conn = array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'user' => 'root',
'password' => '',
'dbname' => 'database',
);
return ConsoleRunner::createHelperSet(EntityManager::create($conn, $config));
Where did I go wrong?
UPDATE
- php version is 5.4.6, OS
- Ubuntu 12.04,
- Doctrine Command Line Interface version 2.4.2
- vendor/doctrine/orm/bin/doctrine file is set as executable and own by the same user as the one trying to run it
UPDATE
As per this discussion, I've been using a wrong driver. Corrections made - no effect.