解决方法
在debian下安装postgresql:
apt-get install postgresql postgresql-client apt-get install PHP5-pgsql adduser mypguser su - postgres psql CREATE USER mypguser WITH PASSWORD 'mypguserpass'; CREATE DATABASE mypgdatabase; GRANT ALL PRIVILEGES ON DATABASE mypgdatabase to mypguser; \q
在/etc/PHP5/apache2/PHP.ini中,添加:(这实际上是可选的)
extension=pdo.so extension=PHP_pdo_pgsql.so
更改symfony apps / config / paramters.ini文件:
[parameters] database_driver: pdo_pgsql database_host: localhost database_port: null database_name: mypgdatabase database_user: mypguser database_password: mypguserpass
重新启动您的项目:
PHP bin/vendors update PHP app/console assets:install web PHP app/console doctrine:schema:create PHP app/console doctrine:fixtures:load chmod 777 -R app/cache app/logs
你完成了!
参考文献: