When I run php -d memory_limit=2G ../composer/composer.phar install, I get an error about the non-existent parameter "database_driver" parameter. However, if I remove all references from my parameters.yml and parameters.yml.dist files then my web-application fails with:
ParameterNotFoundException in ParameterBag.php line 84:
You have requested a non-existent parameter "database_driver".
Did you mean one of these: "database_name", "database_user"?
So it is clear to me that I need this parameter.
I have "database_driver" defined in my parameters.yml and parameters.yml.dist files and it is present in my config.yml file.
**What do I need to change in order to successfully run the 'composer install command?
Note: I also see that the below output of the 'composer install' command says that my composer.lock file is out of date and to run the 'composer update' command, but when I do that, it fails with a out of memory error, which doesn't make sense because I have three gigs of memory on the server and over 28 gigs of free diskspace! If possible, I'd like to try solving the "database_driver" issue first**
Here is the output of the 'composter install' command, above:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in
composer.json. You may be getting outdated dependencies. Run update to
update them.
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
You have requested a non-existent parameter "database_driver". Did you
mean one of these: "database_name", "database_user"?
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
You have requested a non-existent parameter "database_driver". Did you
mean one of these: "database_name", "database_user"?
Here is my parameters.yml.dist file:
# This file is a "template" of what your parameters.yml file should look like
# Set parameters here that may be different on each deployment target of the app,
# e.g. development, staging, production.
# http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: 3306
database_name: ##########
database_user: ##########
database_password: ##########
# You should uncomment this if you want use pdo_sqlite
database_path: "%kernel.root_dir%/data.db3"
mailer_transport: smtp
mailer_host: smtp.sendgrid.net
mailer_user: #############
mailer_password: #############
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ############################
Here is my parameters.yml file:
# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_server_version: 15.1
database_host: 127.0.0.1
database_port: 3306
database_name: ##########
database_user: ##########
database_password: ##########
database_charset: UTF8
# You should uncomment this if you want use pdo_sqlite
database_path: "%kernel.root_dir%/data.db3"
mailer_transport: smtp
mailer_host: smtp.sendgrid.net
mailer_user: ##########
mailer_password: ##########
locale: en
# A secret key that's used to generate certain security-related tokens
secret: #######################
Here is my config.yml file:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
# Put parameters here that don't need to change on each machine where the
# app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: en
framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
templating:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
server_version: "%database_server_version%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: "%database_charset%"
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
# Swiftmailer Configuration
##swiftmailer:
## transport: "%mailer_transport%"
## host: "%mailer_host%"
## username: "%mailer_user%"
## password: "%mailer_password%"
## port : “%mailer_port%”
## encryption: ~
## spool: { type: memory }
Here is my config_dev.yml file:
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: true
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
console:
type: console
channels: [!event, !doctrine]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
swiftmailer:
# delivery_address: ###@####.###
And finally, here is the contents of my composer.json file:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": { "": "src/" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"require": {
"php": ">=5.6.0",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"google/recaptcha": "~1.1",
"sendgrid/sendgrid": "~5.5"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.6.0"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.8-dev"
}
}
}
Thank you for any help on this issue.