1

I tried the following code on SSH to try and set up Error Reporting on a Wordpress Bitnami vm-instance on Google Cloud Console:

sudo -i
sudo nano /opt/bitnami/php/etc/php.ini

auto_prepend_file="/opt/bitnami/vendor/google/cloud-error-reporting/src/prepend.php"

And the vm-instance IP address fails to load after that. (XX.XXX.XXX.XXX)

It keeps reaching a HTTP 500 Error. I posted on Bitnami's support forum after running their support tool, and this thread is the reply:

From what I can see, the errors should be related to your added configuration for Error Reporting. Apache's logs have an error that should be coming from the added google files but we do not have access to them and Error Reporting functioning and configuration is something we are not experts of.

[Wed Mar 17 02:11:30.121059 2021] [proxy_fcgi:error] [pid 1246:tid 140630424536832] [client 203.116.130.16:52842] AH01071: Got error 'PHP message: PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0PHP message: PHP Fatal error:  Unknown: Failed opening required '/opt/bitnami/apache2/htdocs/vendor/google/cloud-error-reporting/src/prepend.php' (include_path='.:/opt/bitnami/php/lib/php') in Unknown on line 0' 
[Wed Mar 17 02:13:08.498151 2021] [proxy_fcgi:error] [pid 1614:tid 140631296952064] [client 203.116.130.16:52847] AH01071: Got error 'PHP message: PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0PHP message: PHP Fatal error:  Unknown: Failed opening required '/opt/bitnami/apache2/htdocs/vendor/google/cloud-error-reporting/src/prepend.php' (include_path='.:/opt/bitnami/php/lib/php') in Unknown on line 0'

Does anyone know what I can do about this error to get the website back up again?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.