tweaks and adding php socket version