Solution:
Enable error logging to help debug:
ini_set(‘log_errors’, 1);
Then check your folder permissions. Make sure you apply the correct chmod so the web server (e.g., WordPress) has write access to that directory.