I'm trying to use the Google messaging system but I'm failing before starting. I'm trying to start with a super simple app that only transmit a "hello world" message and then capture it. Saving it in DB and other tasks will be done after this service is up and running.
However I can't get it to work.I get the error:
[my-app].appspot.com is currently unable to handle this request. HTTP ERROR 500
On logs, I see the problem:
PHP Fatal error: Class 'Google\Cloud\PubSub\PubSubClient' not found in /base/data/home/apps/g~[my-app]/20170809t182312.403268501910529191/printHello.php on line 14
Line 14 is: $pubsub = new PubSubClient([
which is copy paste from google documentation
Consider:
The app is working fine without the:
use Google\Cloud\PubSub\PubSubClient;
. I delete everything except anecho "... some text praying to make it work..."
and it is displayed. So no problem in app.yaml file or somewhere else.I was able to send a message from the topic detail page and receive it in web-console so all authorizations and enabling are done correct.
on local machine, Intellij IDEA recognized the PubSubClient class after I installed beta components. The app is not working on local machine, but I did not even try it. I want to be able to make it work on the server first time.
I checked and all files from local are present on the server as well.
What am I missing? I read all pages I found on cloud.google. ... and all I found on the internet but it seems nobody had a similar problem. So it must be something very simple that I'm doing wrong or have not done. Any suggestions?