Using PHP 5 on the CSAIL Web servers

The main CSAIL Web described at WebServerArchitecture run PHP 5.2 as of January 2012, soon to be PHP 5.3. Files with extensions .php and .php5 will be handled by PHP via FastCGI.

.user.ini files

As of PHP 5.3 (available mid-February 2012), you can customize the PHP configuration your scripts will see by creating a file named .user.ini in the same directory as your PHP scripts, or a higher directory that's within the same web-accessible space. The only valid comment character in this file is the semicolon (;).

Manual entries include .user.ini files and List of php.ini directives

PHP and .htaccess files

.htaccess files are used to customize Apache behavior on a per-directory basis. See HtaccessHints for general background.

  • Do not use the directives php_value and php_flag -- they will trigger 500 Internal Server Error, and "Invalid command 'php_..." will appear in the error log. Instead, use .user.ini files (see above)
  • The following line was recommended before 2010, but is no longer needed and can be deleted if you find it in your .htaccess:
    AddHandler php5-script .php

PHP 5 and SSL variables

If your script depends on being able to get SSL client information from the environment (e.g., with "SSLOptions +StdEnvVars" in your .htaccess file), the prefix REDIRECT_ is prepended to all of their names when invoking a PHP (but not regular CGI) script. For example, SSL_CLIENT_S_DN_Email is known as REDIRECT_SSL_CLIENT_S_DN_Email in PHP scripts.
Topic revision: 03 Feb 2012, ArthurProkosch

MIT Computer Science and Artificial Intelligence Laboratory


  • About CSAIL
  • Research
  • News + Events
  • Resources
  • People

This site is powered by Foswiki MIT: Massachusetts Institute of Technology