This typically has to be done by the server admin. Adding libraries typically requires you to recompile PHP which can only be performed by root/wheel/admin users for proper install.
If you have this access, I'd suggest you read the documentation for the library. All libraries these days include installation instructions with the command line switches needed compile the lib into PHP
If you DON'T have admin access, talk to your host. Our host has been pretty easy going about installing additional libraries. Most hosts will give you something about "if it starts causing problems, we're removing it". Not a big deal though.