Here is the way which worked for me :
- Installed GMP with
apt-get install php5-gmp
- Added
extension=php_gmp.so
to php.ini
Et voilĂ !
phpinfo() sample :
gmp
gmp support enabled
GMP version 4.3.2
It works fine here (Debian), so I suppose it will be ok for Ubuntu too.