It's not a rare thing for me to deploy PHP to a server, or move it from one server to another, and have it completely fail with database or cookie errors. I'd like to get better at avoiding these kinds of issues before they happen.
What are some potential portability problems in PHP, with regards to different servers, OS's, and PHP configurations, and how can they be worked around? Let's assume that I (unfortunately) have no control over the server environment, besides FTP. (I'll add one answer to get things started)