Question: I have a Ubuntu 9.10 server. I have installed apache2 and php5 using the apt-get commands.

How does one install php extensions? Are there commands like apt-get to get them? Or should I manually look for the files on the php website and set them up in the php.ini?

More specifically, I need mcrypt, curl and gd.

Thanks

Answer: 
All you need to do is: 

```
sudo apt-get install php5-mcrypt php5-curl php5-gd

```

If you need to check what is installed php-wise you can:

```
dpkg --list | grep php

```

EDIT: Removed sudo in the command above as it's not needed with dpkg --list.
Additionally, you can review the available PHP extensions on your Debian/Ubuntu system by:

```
apt-cache search php|egrep ^php5-

```