I have set up an Amazon EC2 instance using an Ubuntu image and installed Apache2 as the web server. My application relies on fetching data from Firebase Firestore. However, when I include the line $db = new Firestore(); in my code to instantiate the Firestore object, I encounter an error, and the data retrieval process fails. How can I troubleshoot and resolve this issue to successfully fetch data from Firebase Firestore in my Ubuntu EC2 environment?
My code is as below,enter image description here and my error is,enter image description here
A solution for above issue.