File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
appengine/php72/errorreporting Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 11# App Engine for PHP 7.2 Error Reporting samples
22
3- This app demonstrates how to report errors on on App Engine for PHP 7.2.
3+ This app demonstrates how to report errors on App Engine for PHP 7.2 and shows how
4+ different PHP error types are handled.
5+
6+ To set up ** error reporting** in your App Engine PHP 7.2 application, simply follow
7+ these two steps:
8+
9+ 1 . Install the Google Cloud Error Reporting client library
10+ ``` sh
11+ composer require google/cloud-error-reporting
12+ ```
13+ 2 . Create a [ ` php.ini ` ] ( php.ini ) file in the root of your project and set
14+ ` auto_prepend_file ` to the following:
15+ ``` ini
16+ ; in php.ini
17+ auto_prepend_file =/srv/vendor/google/cloud-error-reporting/src/prepend.php
18+ ```
19+
20+ The [`prepend.php`][prepend] file will be executed prior to each request, which
21+ registers the client library' s error handler.
22+
23+ [prepend]: https://github.com/GoogleCloudPlatform/google-cloud-php-errorreporting/blob/master/src/prepend.php
424
525## Setup
626
Original file line number Diff line number Diff line change 22
33# [START gae_erroreporting_register_handler]
44# After running "composer require google/cloud-error-reporting", register the
5- # error handler by including `prepend.php` in your application
6- require __DIR__ . '/vendor/google/cloud-error-reporting/src/prepend.php ' ;
5+ # error handler by including `prepend.php` in your application. This is most
6+ # easily done in `php.ini` using `auto_prepend_file`:
7+ #
8+ # ; in your application's php.ini:
9+ # auto_prepend_file=/srv/vendor/google/cloud-error-reporting/src/prepend.php
10+ #
711# [END gae_erroreporting_register_handler]
812
913// throw a test exception to trigger our exception handler
Original file line number Diff line number Diff line change 1+ auto_prepend_file =/srv/vendor/google/cloud-error-reporting/src/prepend.php
You can’t perform that action at this time.
0 commit comments