Sometimes when you update wordpress or plugins, especially if you use safe mode, you can get errors like this:
Enabling Maintenance mode.
That’s because wordpress uses strange things for temporary directory. To cure it with non intrusive methods, just add
to the bottom of your wp-config-file. That’s it. Took me about two hours to figure out -_-
UPD. If you have an error “Division by Zero” - then try using the following modification:
$path = $ABSPATH .’wp-content/uploads/’;
Thank for this goes to Rookian (Rookian.com).