PHP Scripting
UGCS fully supports PHP 5 in any space accessible on the web (including virtual domains). You should write your pages as normal php- nothing special is required. We have a large set of libraries installed on our web servers, but don't hesitate to contact us if you need something we don't have.
Database Access
You can access your Postgres database from PHP scripts. You should connect with either
pg_connect("host=postgres user=<username>_cgi dbname=<username>");
or use the database URL (for DB or MDB2)
pgsql://<username>_cgi@postgres/<username>
It is essential that you not specify a password at all, otherwise you will not be able to connect. If you need a MySQL database because your software won't support Postgres, contact us. We have a patched version of mediawiki that will handle postgres correctly (normal versions always try to specify a password even if it is blank)- see Mediawiki on UGCS for more information.
Filesystem Access
Your scripts are run with AFS tokens for <username>_cgi. If you want a directory to be writeable to your php script, you must give <username>_cgi write permissions for it. See AFS for more help.
