
Solution: swoole cannot be run after installation
Solution to the problem that swoole cannot run after being installed: 1. Use the "-name swoole.so" command to find the location of swoole.so. 2. Add swoole.so to the php.ini file.
Dec 18, 2019 am 09:37 AM
Is swoole faster than native PHP?
swoole is faster than native PHP. Swoole is an asynchronous, parallel, high-performance network communication engine for PHP. Save the performance loss caused by the creation and destruction of each request of the PHP framework and global objects. Mainly to supplement PHP's shortcomings in network programming.
Dec 18, 2019 am 09:25 AM
How to use swoole to monitor whether the client is disconnected
In swoole, you can use the "function Server->exist(int $fd):bool;" statement to detect whether the connection corresponding to fd exists. If the TCP connection corresponding to $fd exists, it returns true, and if it does not, it returns false. $fd is the identifier of the TCP client connection.
Dec 17, 2019 am 09:53 AM
swoole custom error method
How swoole customizes errors: swoole can customize errors in the ErrorHandlerInterface interface. When DEBUG.ENABLE is turned on, the custom error handling is effective. Just inject custom errors after the framework is initialized.
Dec 17, 2019 am 09:39 AM
swoole error handling method
In coroutine programming, try/catch can be used directly to handle exceptions. However, exceptions must be caught within the coroutine and cannot be caught across coroutines. Not only Exceptions thrown by the application layer, but also some underlying errors can be caught, such as function, class, and method not existing.
Dec 17, 2019 am 09:24 AM
How to check swoole errors
When a segmentation fault occurs using swoole, you can use the gdb tool to get a copy of bt information. To use gdb tracking, you need to add the --enable-debug parameter when compiling swoole.
Dec 17, 2019 am 09:17 AM
Why is Swoole fast?
Swoole4 can use fully synchronous code to implement asynchronous programs. There is no need to add any additional keywords to the PHP code. The bottom layer automatically performs coroutine scheduling to achieve asynchronous IO. Things that cannot be implemented in PHP, such as database connection pools and cache connection pools, can be implemented under the Swoole engine, and the operating efficiency of the system will be greatly improved.
Dec 16, 2019 pm 02:40 PM
How does swoole support php syntax?
Because swoole is an extension running under PHP, it is actually different from ordinary extensions. After running, the swoole extension will take over control of PHP and enter the event loop. When an IO event occurs, swoole will automatically call back the specified PHP function.
Dec 16, 2019 pm 02:29 PM
How does swoole determine whether fd is connected?
Swoole uses the heartbeat mechanism to determine whether the fd is connected. The client regularly sends a heartbeat packet to tell the server that I am still alive. The server regularly checks the list of all clients to see if the time of their last heartbeat packet is too long. If it is too long, it is considered to have been If there is no heartbeat, the connection is determined to be dead and the connection is actively closed.
Dec 16, 2019 pm 01:57 PM
Can swoole set multiple timers?
Swoole can set multiple timers. The minimum granularity of the swoole timer is 1 second. Supports multiple timers. Note that there cannot be two timers with the same interval. After adding the timer, you need to write a callback function.
Dec 16, 2019 pm 01:52 PM
Which framework of swoole is used the most?
The Swoft framework of swoole is widely used. Swoft is a PHP microservice coroutine framework based on the Swoole extension. Swoft, like Go, has a built-in coroutine network server and commonly used coroutine clients and is resident in memory, without relying on traditional PHP-FPM.
Dec 16, 2019 pm 01:45 PM
Is the threshold for swoole high?
Swoole has a high threshold. Swoole is for experts. The threshold is relatively high and requires users to have deep skills. Swoole is actually just a low-level library, not a complete product that can be used. However, there are many PHP frameworks and programs based on swoole, which can be developed directly based on these projects.
Dec 16, 2019 pm 01:36 PM
Does the swoole service only start one process?
No, if you start a TCP server, 3 worker processes and 3 task processes will be started. Because the task function is enabled, the callback functions of the onTask and onFinish events must be registered.
Dec 16, 2019 am 11:59 AM
What is the swoole port?
A port can be thought of as an outlet for communication between the device and the outside world. Ports can be divided into virtual ports and physical ports. Virtual ports refer to ports inside a computer or a switch router and are invisible. Swoole-1.8.0 adds support for multi-port mixed protocols. Server can listen on multiple ports.
Dec 16, 2019 am 11:51 AM
Hot tools Tags

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version
Chinese version, very easy to use

Hot Topics









