If you really want to play with CGI, upgrade to an Advanced account just once, and you'll get shell access on all your sites.This really helps with debugging.
Things we won't support that we've already been asked to are user MySQL databases and non-cgi based PHP (we will support postgres, however). You can usually find a script out there that does the same thing you want and uses Berkeley DB, SQLite or flat files. Just use those instead.
If you want to use PHP, just put it in the cgi-bin directory and CHMOD it to 750. We know that CGI is less efficient. But you can build very efficient PHP CGI code, if your scripts produce static HTML. And you can upload an .htaccess file that uses a RewriteRule to make the cgi-bin transparent to your users. Our wiki uses this.
Here's a great CGI tutorial.