You can go right to Google and build the WebP libraries from source. Use this link to get the appropriate archive for your operating system:
https://developers.google.com/speed/webp/docs/compiling#building
Then you can use the following command within a php system() function to convert the images:
Syntax:
cwebp [quality
qualitypercentage] [source
image] -o [destination]`
cwebp -q 80 source.png -o
destination.webp
I would recommend reading the above link to get your libraries compiled, then go here to get more information about using the libraries.
Best of luck with the project!