Hello,
Assuming you are on linux, vagrant will have limited access to some folders, so you can copy to some folder where vagrant can read/write, and then use sudo
vagrant ssh will connect you as vagrant user
ls -al /usr/lib/php/20151012
Will show the permissions there.
usually the steps would be
copy the files to the folder where Vagrantfile is
then as you may have shared folders, you could do
sudo cp <file>.so /usr/lib/php/20151012
then use sudo chown to set proper permissions there
if you use scp, copy as vagrant to /home/vagrant and then use the ssh with sudo cp to copy to the final destination.
Alvaro