Probably a stupid question but can I configure php5 with --prefix=path_to_lsws/php5 and install it in the lsws directory, and then if I don't want it just delete that directory?
PHP install some libraries like PEAR into the installation directory, if you remove it, the lsphp binary you built may not work properly if any library is used.