The best way to do something like instant messager is to just use something like instant messenger.
Corny I know, but what you want is peer-to-peer connections, and PHP/HTTP can only do client-server-client, which means your server will get twice the traffic that your clients get.
Plus, you cannot send data to clients through HTTP, they must request it from you. So to keep things up to date, you need to refresh regularly, say once every 10-20 seconds. If two people are chatting, they will request their chat pages once very ten seconds. Now think of having 50 users, half of which are chatting with 2 people at the same time, that's 75 page request every ten seconds, that's 7 pages/second. At 60k per page, you are blowing out 420k/sec, or 36GB per day. Do you really want that? 🙂