There are issues with running the tw console app and the web application as different users, specifically the home directory location and MySQL configuration, so I've switched this around a bit, such that the console uses 'phpfpm' user, by having 'tw' be a bash script that invokes the tw.php script.