App Engine - Enable Cloud Debugging for PHP

250 views
Skip to first unread message

Bilal Haidar

unread,
Apr 12, 2021, 5:37:03 PM4/12/21
to Google App Engine

Hi,
I followed the instructions on the page https://cloud.google.com/debugger/docs/setup/php?authuser=1

I am using App Engine Flex. At once the docs asks to do the following:


App Engine flexible environment pecl install stackdriver_debugger-alpha

If your php.ini file does not include extension=stackdriver_debugger.so after running this step, add it manually.


On App Engine Flex, how can I access the php.ini to include that extension?

I did the rest of steps, however, when running cloud_build on App Engine, I get error something like "install google/cloud or google/error-reporting packages". I already have Google/cloud installed.

Most probably, the extension is missing from php.ini and that's why it's not working.


I appreciate your help.

Thanks

Alexis (Google Cloud Platform Support)

unread,
Apr 13, 2021, 12:52:10 PM4/13/21
to Google App Engine
Hi,

It will be a pleasure to help.

App Engine works by uploading/deploying your local configuration and code. This means you would start locally first. Therefore, if your php.ini is in the root folder of your local code, it should work. In the document you provided, some details are omitted for the entire App Engine process of configuration since it's mostly about Cloud Debugger. However, the rest of the details on how the configuration works for App Engine can be found here[1]. 

In your case, the php.ini is fairly standard to the runtime and not proprietary to App Engine's YAML, but more part of your codebase and the root folder structure. The explicit answer is located here[2] (where it says "If you need any of the above functions, add a php.ini file in the root of your application"). Also, please note the section below that, that also talks about describing the root folder in the YAML. You may find all the details on that page.

Let us know if that solves your issue. Thank you.

Sincerely,

Alexis
Google Cloud Platform Support

Bilal Haidar

unread,
Apr 13, 2021, 1:11:32 PM4/13/21
to google-a...@googlegroups.com
Hi Alex,
Thanks a lot for assisting here. I will surely check it and try it out.

I have one question though. Basically, I am enabling stack driver so that my app, Laravel, would send its log to stack driver which is read by GCP Cloud Debugger? Do I get the idea here? Maybe I miss the point, I am just asking to get more info.

Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/3zU3bF8O8sw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/dc1a4854-de71-4729-9e6c-f8b1193c25a1n%40googlegroups.com.

Alexis (Google Cloud Platform Support)

unread,
Apr 13, 2021, 2:45:52 PM4/13/21
to Google App Engine
Hi Bilal,

I suppose you are asking why use App Engine? 

The article you provided says that you can use App Engine, Compute Engine, Kubernetes Engine, etc... Your question was about App Engine, so I linked the App Engine documentation.

In general, the Operational Suite (formerly "Stack Driver") requires some sort of VM to operate the logs. These VMs are hidden from you when you use a Google Service and it's included inside of it, along with the rest of the code. However, in this case I suspect you use your own service/framework for your code and the logs are not embedded as part of the Google infrastructure. So, you need a VM of some sort to merge the logs with GCP's infrastructure tools. Any of the selections above will do.

Hope this answers your question.

Sincerely,

Alexis
Google cloud Platform Support

Bilal Haidar

unread,
Apr 15, 2021, 3:27:54 AM4/15/21
to google-a...@googlegroups.com
Hello Alex,
Thanks again for the help.

I understand from you that if I follow the instructions on how to enable Cloud Debugger with the StackDriver on my PHP Larave app, including the php.ini file, Is should be viewing my PHP Laravel app logs inside the Stack Driver somewhere on GCP Dashboard. Correct?

Regards
Bilal

Alexis (Google Cloud Platform Support)

unread,
Apr 15, 2021, 9:11:06 AM4/15/21
to Google App Engine
Hi Bilal,

That is correct. The instructions for Cloud Debugger allows the link between your code and the graphical user interface of Google Cloud Platform, so that you can see information with the StackDriver/Debugging tool in our Dashboards. An example on how to view that is shown here https://cloud.google.com/debugger/docs/quickstart#view_deployed_source_code

Sincerely,

Alexis
Google Cloud Platform Support

Bilal Haidar

unread,
Apr 15, 2021, 9:33:33 AM4/15/21
to google-a...@googlegroups.com
Thanks a million Alex!

Reply all
Reply to author
Forward
0 new messages