Installer postgresql under debian:
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
Tilføj i /etc/php5/apache2/php.ini:(dette er faktisk valgfrit)
extension=pdo.so
extension=php_pdo_pgsql.so
Skift filen 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
Genoptag dit projekt:
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
Du er færdig!
Referencer:
Symfony dokumentation til konfiguration af databaser
Postgresql-installation under debian