I'd be interested in any solutions to this.
I have the same issue with PHP 7.0 as I try to install PECL APCu.
Build process completed successfully
ERROR: failed to write /usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/apcu.so (copy(/usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/apcu.so): failed to open stream: Permission denied)
I looked at
and saw that that directory was also showing up as the PEAR extensions directory, so I used
pear config-set ext_dir /home/$USR/pear/ext
to set it to to my user directory ($USR = my user name).
But I run it, I still get the same error at the end with it trying to access the '/usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/ directory.