I’m stuck at this for hours and searched in forums, couldn’t find the answer.
After successfully tested notifications using HTTPie
, I got some errors when Run php sendPushes.php
in terminal, it says:
Fatal error: Uncaught PDOException: SQLSTATE[08006] [7] connection to server at “localhost” (::1), port 5432 failed: FATAL: password authentication failed for user “apns” in /Users/abc/Desktop/sendPushes.php:17
Stack trace:
#0 /Users/abc/Desktop/sendPushes.php(17): PDO->__construct(‘pgsql:host=loca…’)
#1 {main}
thrown in /Users/abc/Desktop/sendPushes.php on line 17
and in Docker it shows this:
webservice-db-1 | 2021-11-30 10:09:37.148 UTC [118] FATAL: password authentication failed for user “apns”
webservice-db-1 | 2021-11-30 10:09:37.148 UTC [118] DETAIL: Role “apns” does not exist.
It seems like it’s something wrong with user
and password
in $db = new PDO('pgsql:host=localhost;dbname=apns;user=apns;password=password');
? But I followed the book several times and can’t find somewhere say these parameters need to be specified.
The AUTH_KEY_PATH
, AUTH_KEY_ID
, TEAM_ID
and BUNDLE_ID
have all been set correctly.