Changed line endings to linux on mainscript.php because of the interpreter on the CLI having an extra ^M, causing it to not find php.