Loading wp-load.php in an external PHP file throws unknown error

Ok, I’ve fixed it. Turns out that there was a php class name that was getting redeclared. Declared once in the theme, and once in the plugin.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)