HTTP_Accept_language would be the normal setting.
Unfortunately, the error you are getting is from a generally used function, so the calling sequence is probably what is wrong. For these cases we need preferably a stack trace of the error. That may be possible to configure in your PHP. If not that then as much detail as to what was happening as possible.