Did you fix DB issues? May as well do it now. But don't think those DB issues relate to 403 errors.
The 403 in logs indicate 'access denied'. Check ownerships/permissions on all folders/files in code and on a folders/files in moodledata.
Code .... readable by all but writable only by owner group readable should be ok - that owner is the web service user.
Data directory .... needs it all.
'spirit of sharing', Ken
Thanks very much for your help.
Seemingly this uses the Barracuda format by default, as the error is no longer there and running the first php script showed nothing needed changing.
I was able to change the uft format with the other command. In order to do it I had to optimise the mdl_logstore_standard_log table.
I also tried changing all permissions for moodle and moodledata to 705 / 604.
I also stopped showing the Notifications icon in /admin/message.php.
One of these things has stopped the Undefined popups nag, but I am not sure which. I think it may actually have been the utf format change and logstore optimisation!?