is PHP suitable for the service of app Instant Messaging?

Source: Internet
Author: User
A friend want to do the Android version of the Instant messaging app, just for PHP will be some, want to ask everyone PHP suitable for instant messaging service side? What are the pros and cons?

Reply content:

A friend want to do the Android version of the Instant messaging app, just for PHP will be some, want to ask everyone PHP suitable for instant messaging service side? What are the pros and cons?

To be honest, there are some reluctance to use the traditional PHP only for instant messaging. PHP has no advantage in dealing with dense high concurrency and long connections.
Industry-wide solutions are nodejs to do. But it does not mean that the modified PHP is not competent.
PHP has an extension called swoole can help you achieve this Instant Messenger service, it is said that the QPS has been nodejs. Recommended to understand, and there is a source of instant communication available.

The right can no longer fit.

Phpwebim communication architecture based on Swoole:
Https://github.com/matyhtf/php-webim
demo:http://webim.swoole.com/
1. The server driven by NGINX/PHP-FPM provides HTTP services, such as listening on 80 ports:
The browser accesses http://webim.swoole.com/main.html to obtain the data generated by the nginx/apache+php service.
The WebSocket Service (CLI program) implemented by the 2.PHP Swoole listens to a single port, such as 9503:
The main.html page uses JavaScript to access ws://webim.swoole.com:9503 to get the data generated by the WebSocket service.

This is swoole need to play the ultimate demand ah, this kind of thing, using libevent and pure C implementation Swoole is relatively more appropriate than PCNTL-based Workerman.

There have been similar studies before, but not in depth, http://xmpp.org/xmpp-software/servers/for reference only

Thank Wu faint classmate to help me ask questions, also thank you to provide ideas, I decided to use Workerman try?

If concurrency is not particularly high, you can

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.