How do I enable additional PHP extensions?
Several PHP extensions are installed on the scripts servers, but not enabled by default. (Since most scripts do not use these extensions, this saves startup time and memory.) You can load any of these extensions by creating a text file called php.ini
in the same directory as your PHP script, and adding a line with:
extension = [extension name].so
one line for each extension you want to enable.
Note that this will override some settings in the global php.ini — most importantly, this will cause magic_quotes_gpc to turn on! You should make sure that your application unsets this option, or set magic_quotes_gpc = no in your own php.ini file.
If your site is composed of several subdirectories, instead of creating a php.ini
for each one you can add scripts
and then fix-php-ini
in the root directory of your site where your php.ini
is located. fix-php-ini
will traverse the directory and place symlinks as needed.
The following are the extensions installed on the scripts servers, with links to more information about them from the PHP website.
- bcmath
- curl
- dba
- dom
- fileinfo
- gd
- imap
- imagick
- json
- ldap
- mailparse
- mbstring
- mcrypt
- mysqlnd
- mysqli
- ncurses
- odbc
- pdo
- pdo_mysqlnd (requires mysqlnd and pdo)
- pdo_odbc (requires pdo)
- pdo_pgsql (requires pdo)
- pdo_sqlite (requires pdo)
- pgsql
- rrdtool
- snmp
- soap
- tidy
- xmlreader
- xmlrpc
- xmlwriter
- xsl
- zip
Previous: | How do I make IPython or manage.py shell work on scripts.mit.edu? |
Next: | Why does my PEAR channel say it does "not have REST dependency information available" |
These pages may be reused under either the GFDL 1.2 or CC-BY-SA 3.0.
Questions? Contact scripts@mit.edu.
You are currently connected to shining-armor.mit.edu.