
A fully asynchronous high-performance network library that is efficient, stable, safe and easy to use, and online real-time verification is provided through PHP extension.
Following the Apache protocol, it is based on the branch reconstruction and development of Swoole version 1.8.5.
I would like to express my special thanks to the Swoole development team for their efforts and sweat for the PHP open source community.
What did Zan do
- Decoupling and splitting a large number of modules
- Fix a large number of bugs and logic defects (memory leaks, releases logic)
- Built-in universal connection pool
- Support time round algorithm
- Asynchronous interface supports timeout
- Enhance the security of Mysql client (preprocessing, transactions)
- Nova protocol support (RPC protocol)
- Supports smooth restart
- Interface unit test coverage 100%
- Real-time, comprehensive API documentation
- ...
Compilation and installation steps
The master branch has made major changes and is still in the internal testing stage. It is not recommended to enter the production environment. If it is required to be stable, you can download the release version
git clone https://github.com/youzan/zan.git
cd zan-extension
phpize
./configure
make
make install
It is recommended to install configuration items
phpize
./configure --enable-openssl
make
make install
Zan Compilation and Installation FAQ
- Use the async-redis client and dependency sockets extension to be opened by default, and use the ssl function to not be opened by default.
- If you do not want to use the async-redis client, you can use the option
--disable-async-redis to turn off when configure. - Using the async-redis client requires the hiredis library to be installed. Currently, the hiredis library for linux/mac under x86 is provided by default. If you need to support hardware platforms such as arm, you need to install the hiredis library first, and then add
PHP_ADD_LIBRARY(hiredis, 1, ZAN_SHARED_LIBADD) to the config.m4 file to compile it into the ZAN extension. - If you want to use the ssl function, you can use the option
--enable-openssl to enable it when configure.
- If you execute phpize to report xxx/sed: No such file, please reinstall php or copy /usr/bin/sed to the xxx directory.
- If you execute phpize to report Cannot find autoconf, please install the autoconf tool first.
- If the error libcurl not installed when executing configure, please reinstall the curl library and ensure that the name and path of the library and header file are correct.
- If the library name and path /usr/lib/libcurl.so (usually libxxx.so.xxx with version number will be softly connected to libXXX.so for linker identification), the corresponding header file path is /usr/include/curl.
- After confirming that the curl library is installed correctly, be sure to rephpize && configure to ensure that the new configuration takes effect.
- If an error is still reported after pressing 1) and 2) operations, you can modify the configuration path of PHP_CURL in config.m4 to install curl for you.
- If you report an error when executing configure enable sockets support, sockets extension installed incorrectly, please confirm that the PHP version and sockets extension are correctly installed.
- The PHP version needs to be version 5.6 or above.
- The header file ext/sockets/php_sockets.h should be included in the include path of PHP.
- The sockets extension is loaded before zan (introduced loading order in php.ini) to ensure that symbol table information can be referenced.
- If you report an error when executing configure Enable openssl support, require openssl library, please reinstall the openssl library and ensure that the link is correct.
- Reinstall the openssl library.
- Add the openssl library path for the linker to find lib, such as supplementing
-L/usr/local/opt/openssl/lib to LDFLAGS in config.m4. - Add the openssl library to depend on the header file path, such as adding
-I/usr/local/opt/openssl/include include to CPPFLAGS in config.m4. - Reconfiguration is still needed, and install it according to the compilation extension steps, see above.
Official communication channel
Official website: Click me to enter
Zan's document warehouse address: zan-doc
View the document online: http://zandoc.zanphp.io ✈
QQ group: 115728122
Commonly used links
- Asynchronous network model
- PHP asynchronous programming: teach you how to implement co and Koa step by step
- In-depth understanding of PHP opcode optimization
- Zan-Stats Monitoring Tool
Donate to us
Donation channel
License
The Zan framework is open sourced based on Apache2.0 license.