dpa89292 2016-05-12 09:25
浏览 57
已采纳

Symfony3不读取Elastic Beanstalk上的环境变量

Everything works fine on my local machine. printenv | grep SYMFONY on my local machine prints me this

SYMFONY__DATABASE_HOST=127.0.0.1
SYMFONY__DATABASE_NAME=database
SYMFONY__DATABASE_PASSWORD=root
SYMFONY__DATABASE_PORT=3306
SYMFONY__DATABASE_USER=root

My config.yml contains the following configuration:

# Doctrine Configuration
doctrine:
    dbal:
        driver:   pdo_mysql
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"

On my ec2 machine printenv | grep SYMFONY prints the same as above.

My elastic beanstalk environment variables

But i get the following error message

$ sudo bin/console doctrine:schema:update --force 

[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
      You have requested a non-existent parameter "database_host".

EDIT: oh and phpinfo(); printes them too. Don't mind the double host and name variables. I tried something.

  • 写回答

1条回答 默认 最新

  • doubao6936 2016-05-12 11:25
    关注

    I made a clean deploy, terminated the ec2 instance and let elastic beanstalk rebuild the ec2 instance.

    After that everything worked fine. Maybe i changed some chmods.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵
  • ¥15 cfx离心泵非稳态计算