define $debug to avoid annoying message in stderr log
fix media upload from url bug
use SERVER_NAME for forgot password base url