Google AppEngine Deploy Error (cloud-error-reporting)

236 views Asked by At

I have an App (PHP 7.4) running on Google AppEngine Standard. Now i have created a new Project inside CloudConsole wih same settings and want to deploy this App to the new generated Project for testreason.

gcloud app deploy app.yaml --project=testapp-2022-08-14

But i am getting this error:

Fatal error: Unknown: Failed opening required '/srv/vendor/google/cloud-error-reporting/src/prepend.php' (include_path='.:/layers/google.php.runtime/php/lib/php') in Unknown on line 0

To activate the Cloud-Error-Reporting i followed this Documentation: CloudErrorrEPORTING

my php.ini

auto_prepend_file = '/srv/vendor/google/cloud-error-reporting/src/prepend.php'
session.gc_maxlifetime = 259200
opcache.memory_consumption = 128

my app.yaml

runtime: php74
instance_class: F1

entrypoint: serve bootstrap.php

handlers:
  ...
  
env_variables:
  ...
  
runtime_config:
  document_root: .

automatic_scaling:
  max_instances: 20

any help is welcome

1

There are 1 answers

2
user3575866 On

Using AppEngine's standard configuration with PHP 7.4 runtime, we encountered the same issue recently, and the value set for auto_prepend_file registering the library in php.ini in the standard setting no longer works. As we checked the sample repository, we discovered that they suggested registering error handlers manually as a workaround if php.ini cannot be accessed.

In our case, registering the error handler manually, resolved the issue.

# This works for files in the root of your project. Adjust __DIR__ accordingly.
require_once __DIR__ . '/vendor/google/cloud-error-reporting/src/prepend.php';

Take a look at the sample repository and verify that your configuration is set up correctly as well.

https://github.com/GoogleCloudPlatform/php-docs-samples/tree/6609166f71b1049f45360480963c2327b00b7959/appengine/standard

Hope this helps!