AppEngine Standard PHP7.4 Deploy-Error

297 views
Skip to first unread message

Sirko Uhl

unread,
Aug 18, 2022, 4:49:59 AM8/18/22
to Google App Engine
I have an App (PHP 7.4) running on Google AppEngine Standard and deploy works fine. Now i have created a new Project inside CloudConsole with 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

Can anyone help?

Ernesto Contreras Pinon

unread,
Aug 22, 2022, 11:41:13 AM8/22/22
to Google App Engine
From the documentation, the path to the prepend.php file should be as follows: /<WORKSPACE>/vendor/google/cloud/cloud-error-reporting/src/prepend.php. The path you included in your php.ini is a bit different, have you previously tried with the exact path shown in the documentation?

Sirko Uhl

unread,
Aug 23, 2022, 3:50:17 AM8/23/22
to Google App Engine
Hello Ernesto

thanks for your response. I have also seen this difference. But i think this is a error in the documentation. If you look in the vendor directory there is no path named /vendor/google/cloud/.

In the meantime, however, I have found several solutions.

1. it's documented in this documentation.  If you cannot modify your php.ini, the prepend.php file can be manually included to register the error handler:
    require_once __DIR__ . '/vendor/google/cloud-error-reporting/src/prepend.php';
    found by another at stackoverflow.

2. worked for me, if i use the relative Path  ./vendor/.../...

Sincerely

Reply all
Reply to author
Forward
0 new messages