The errors you are receiving is because the module you are attempting to install/upgrade was built using a different version of PHP.
Either install the same version of PHP for which the modules were built with OR simply compile the modules manually which is quite easy to do.
1) Download pecl module and untar
2) cd into module directory and phpize
3) ./configure
4) make && make install
Make sure the modules are install into the proper extensions directory too so the php.ini can load them. Some pecl modules have specific ./configure options too, you can check those by running ./configure --help
before compilation.