Safest way: (there are probably ways with less downtime, but more tricky)
1) stop searchd (gracefully, dont kill it)
2) install new version of sphinx (just like was installing it for the very first time)
3) overwrite the version of sphinxapi.php (.py etc) used in your application from the fresh version.
4) Start searchd again.
5) Test, Test, Test.
6) if any issues, first try regenerating yuor indexe(s) - can just use --rotate.
(you might also want to replace the search pae on your app witha 'closed for maintaincne' so any visitors get a clear message what is going on, rather than a cryptic messae. Having said that, fr the most part the downtime, shuld be less than a minute)