Export PostgreSQL database with php -


hello i'm trying export specific postgresql database using php laravel 5.

i thinking in using exec , pg_dump this

$command = 'pg_dump -u ' . env('db_username') . ' -h ' .env('db_host') . ' -p ' . env('db_port') . ' -f ' . $file . ' -d ' . env('db_database'); exec($command); 

but fails because i'm not able de write password when asked... there way make dump of postgresql database using exec?. or there uis better way php?.

thanks


Comments