1) Fixed 404 errors in app
2) Added fallback for php environment for CLI commands