HTTP 500 Error After Trying To Set Up Error Reporting on Google Cloud Console

Solution 1:

Bitnami Engineer here!

I think you added that line to your php.ini file but indeed forgot to install the Google Cloud Error reporting utility to that location. Additionally, I think you are setting the wrong path, as the utility expects to be installed in the project directory (Ref: https://cloud.google.com/error-reporting/docs/setup/php)

  1. As you are using WordPress, you should use the following directory to install the utility /opt/bitnami/apps/wordpress/htdocs. But first, remove the line you added in the php.ini file:
$ sudo nano /opt/bitnami/php/etc/php.ini
auto_prepend_file=
  1. Follow the install instructions and install the utility using composer in the WordPress's (or your app's) directory:
$ cd /opt/bitnami/apps/wordpress/htdocs
$ sudo -u daemon composer require google/cloud-error-reporting
  1. Re-set the line again in the php.ini file, this time pointing to the right location:
$ sudo nano /opt/bitnami/php/etc/php.ini
auto_prepend_file= '/opt/bitnami/apps/wordpress/htdocs/vendor/google/cloud-error-reporting/src/prepend.php'
  1. Create env. variables with your Google Cloud Project Name (remember to change YOUR_GOOGLE_CLOUD_PROJECT_NAME in the commands below 🙂):
$ export GOOGLE_CLOUD_PROJECT=YOUR_GOOGLE_CLOUD_PROJECT_NAME
  1. Now restart your services and you should be ready to go!
$ sudo /opt/bitnami/ctlscript.sh restart