dry69034 2016-02-15 13:49
浏览 79

找不到驱动程序pdo_pgsql symfony 2.8

I made a lot of search and didn't find any solution. Whenever I try to php app/console doctrine:database:create, SF2 returns me an error "could not find driver".

I went in /app/config.php and configured my php.ini correctly. Extensions are uncommented and enabled.

php -m tells me pgsql is activated. phpinfo(); too, and also tells me the path of the bin which's used. (which is the one noticed on /web/config.php).

I tried all I could, but i can't create a database.

Any help would be appreciated.

doctrine:
dbal:
    driver:   pdo_pgsql
    host:     "%database_host%"
    port:     "%database_port%"
    dbname:   "%database_name%"
    user:     "%database_user%"
    password: "%database_password%"
    charset:  UTF8


extension=pgsql.so
extension=pdo_pgsql.so (in php.ini)

I don't know ...

  • 写回答

2条回答 默认 最新

  • duanqiao3608 2016-02-17 09:36
    关注

    I found a solution, my SF2 project was using a wrong php bin (wrong path). My web server's correctly running with php 7 but my CLI's using php 5 bin. Simply create a script in your ~/.bashrc_profile (mac user) and copy/paste this into it : `

    export PATH=/usr/local/php5/bin:$PATH 
    

    (if you installed php 7 on your mac and his bin is located in /usr/local/php5).

    If you're using MAMP as webserver, copy paste this :

    export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH
    

    Then you can tip

    php app/console doctrine:database:create
    

    And enjoy !

    评论

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法