There are two common reasons this happens:
1. The version of PHP you're running doesn't support the code in your PHP file. This could happen because you're using an older version that doesn't support newer syntax or a newer version and including depricated/removed syntax.
2. More commonly, you are using an FTP file that is causing a BOM marker to be injected in your PHP files which causes the PHP interpreter to fail reading your PHP files. If you are running into option 2, the easiest solution is to change the upload file type from ASCII to Binary. By telling the FTP app to upload the files as binary, they will not modify the files to add a BOM at the beginning of the file.
View API documentation, code samples, get your API key.