I currently following CMF docs to create a project : https://symfony.com/doc/master/cmf/tutorial/introduction.html
As i continue on Tutorial, i like to push the project to heroku. But i ran in to a problem when i need to have database connection.
Than i found this source : https://coderwall.com/p/qpitzq/deploing-symfony-project-using-mysql-to-heroku
That helped but i need to configure also 'phpcr_backend' parameters. I set them on console:
heroku config:set phpcr_backend=[type:doctrinedbal,connection:default]
or
heroku config:set phpcr_backend=(type:doctrinedbal,connection:default)
or
heroku config:set phpcr_backend={type:doctrinedbal,connection:default}
or
heroku config:set phpcr_backend=type:doctrinedbal,connection:default
heroku config:set phpcr_workspace=default
heroku config:set phpcr_user=admin
heroku config:set phpcr_pass=admin
and update parameters_production.php file:
<?php
$db = parse_url(getenv('...'));
...
$container->setParameter('phpcr_backend', getenv('phpcr_backend'));
$container->setParameter('phpcr_workspace', getenv('phpcr_workspace'));
$container->setParameter('phpcr_user', getenv('phpcr_user'));
$container->setParameter('phpcr_pass', getenv('phpcr_pass'));
Now, when i deploy the project im getting this error :
[Symfony\Component\Config\Definition\Exception\InvalidTypeException]
Invalid type for path "doctrine_phpcr.session.sessions.default.backend". Expected array, but got boolean
Im not sure, im setting those parameters on correct syntax. For now this is the problem.
Edit:
I hard coded doctrine_phpcr parameters in config.yml file :
doctrine_phpcr:
# configure the PHPCR session
session:
backend: { type: doctrinedbal, connection: default}
workspace: default
username: admin
password: admin
# enable the ODM layer
odm:
auto_mapping: true
auto_generate_proxy_classes: "%kernel.debug%"
Currently error is
PHP Fatal error: Cannot use 'String' as class name as it is reserved in /tmp/build_4d5c173733f27d9fb1cec775f9522884/ersah123-cmf-testing-118c5df/vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/String.php on line 32
Edit 2:
By changing php version in composer.json, fixed the last issue. Now, when i deploy the project build success. But having another problem:
heroku run php bin/console doctrine:database:create
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
Your help would be appreciated