I successfully execute the following command through the terminal:
pg_dump -d teste -h 127.0.0.1 -p 5432 -U postgres -w -f /home/william/pgsql/17032701.backup
However, when I execute the command by shell_exec
of PHP
, I get the following return:
pg_dump: [archiver (db)] connection to database "teste" failed: fe_sendauth: no password supplied
I need to create a routine where the user can create the backup of the database through the system interface. However, the user does not have the password (and even if it had, it would not be necessary to inform the password).
If on the command line, I remove -w
, in both runs ( shell_exec
and terminal
) it is necessary to enter the password to proceed. But this is far from my ideal.
In my search for the solution, I tried to change the settings of pg_hba.config
, but without success.
Thank you in advance.