PHP catchable fatal error in Moodle 3.3 Google G-Suite

PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Phuong Hoang -
Number of replies: 8

Hi guys,

I'm a big fan of Oauth2 authentication plugin. Therefore, I'm eager to upgrade to moodle 3.3 to use OAuth 2 services. I spend several days (changing chmod, php setting...) to make it work but no luck. I have created the OAuth 2 services described here: https://docs.moodle.org/33/en/OAuth_2_authentication, however I wondered whether I missed something or not.


When I log out, my site appears; PHP catchable fatal error. If I delete or disable OAuth 2 services, my site works normally. I'm using Hosting Linux DirectAdmin. I read this thread; https://moodle.org/mod/forum/discuss.php?d=353000 but I can't solve my problem!

I'm looking forwards to your detailed instruction, guys!

Thanks in advance,

Average of ratings: -
In reply to Phuong Hoang

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Ken Task -
Picture of Particularly helpful Moodlers

Think, before anyone could begin to attempt help, you might need to share what:

"PHP catchable fatal error" means or shows or looks like.

'spirit of sharing', Ken


In reply to Ken Task

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Phuong Hoang -

Hi Ken,

Thanks for your reply. When I log out, my site says; "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error"

In reply to Phuong Hoang

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Ken Task -
Picture of Particularly helpful Moodlers

On logging out???!!!!

Turn on Debugging and let's see if there is anything reported.

'spirit of sharing', Ken


In reply to Ken Task

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Phuong Hoang -

"On logging out" it means that I log out my admin account. In other words, no users can see my site when they hit my site url for example; http://xxx.net, however they can log in normally when they hit http://xxx.net/login/index.php.

- On logging out, it says: 

Notice: Undefined index: icon in /home/wwcfilgo/domains/thaytro.net/public_html/blocks/login/block_login.php on line 123

"Coding error detected, it must be fixed by a programmer: PHP catchable fatal error"

- Turn on Debugging (enable or disable has the same warnings)

Warning: is_readable(): open_basedir restriction in effect. File(/proc/loadavg) is not within the allowed path(s): (/home/wwcfilgo/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/) in /home/wwcfilgo/domains/thaytro.net/public_html/lib/moodlelib.php on line 9121

Warning: is_executable(): open_basedir restriction in effect. File(/usr/bin/uptime) is not within the allowed path(s): (/home/wwcfilgo/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php56/lib/php/) in /home/wwcfilgo/domains/thaytro.net/public_html/lib/moodlelib.php on line 9124

* Note: My site works normally when I disable or delete Oauth 2 services

In reply to Phuong Hoang

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Damyon Wiese -

Have you got any of the older OAuth2 plugins installed on your site (e.g. this one: https://moodle.org/plugins/auth_googleoauth2) ?

Average of ratings: Useful (1)
In reply to Damyon Wiese

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Phuong Hoang -

Yes, sir. Before upgrading to moodle 3.3, I used this plugin - auth_googleoauth2

In reply to Phuong Hoang

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

In which case, I think Damyon is saying that you need to uninstall the auth_googleoauth2 plugin for OAuth 2 authentication to work correctly in Moodle 3.3.

In reply to Helen Foster

Re: PHP catchable fatal error in Moodle 3.3 Google G-Suite

by Phuong Hoang -

Hi Helen and Damyon,

Certainly, I uninstalled auth_googleoauth2 before upgrading.

Basically I resolved my error. It was my fault; I modified block_login.php in the previous version, then I reused this file in the new one - deleted the old file and uploaded the new one - resolved my error. However, Oauth 2 services only works normally when I untick "Prevent account creation when authenticating". But I get errors The login attempt failed. Reason: An account with your email address could not be found.when I tick "Prevent account creation when authenticating". But I prefer "Prevent account creation when authenticating". In addition, the emails that having logged in the site via auth_googleoauth2 may cause problems so we have to delete them. Unfortunately, I have hundreds of them.

Thanks for your reply and your time,