• Example of implementing real-time asynchronous task queue with PHP extended swoole


    The example of this paper describes how to extend swoole in PHP to realize real-time asynchronous task queue. To share with you for your reference, as follows: If want to send 100 mail, for circulates 100 times, the user rises directly, what break a website! But in fact, we are likely to have more than […]

  • PHP process: go + Chan + defer


    Swoole4byPHPLanguage provides powerfulCSPCo programming mode. The bottom layer provides3Key words, can easily achieve all kinds of functions. Swoole4ProvidedPHP AssociationGrammar fromGolangIn this directionGODevelopment team Tribute PHP+SwooleThe process can work withGolangWell complemented.GolangStatic language, rigorous and powerful, with good performance,PHP+Swoole: dynamic language, flexible and easy to use This article is based onSwoole-4.2.9andPHP-7.2.9Edition Key word go: create a process […]

  • PHP to realize the payment of the union business official account + service window payment


    Before we learned the H5 payment of union business, but now H5 payment does not support WeChat payment, and finally found that the official account of the UnionPay business + service window payment can support Alipay payment + WeChat payment + union pay. 1. Interface address: Test interface address: https://qr-test2.chinaums.com Official interface address: https://qr.chinaums.com/netpa 2: […]

  • Manually install and configure yii2 redis extension


    Click download: yii2.0-redis extension Put the downloaded extension file under vendor / yiisoft /, and name it yii2 redis Modify extensions.php under vender / yiisoft / and add redis extension ‘yiisoft/yii2-redis’ => array ( ‘name’ => ‘yiisoft/yii2-redis/src’, ‘version’ => ‘’, ‘alias’ => array ( ‘@yii/redis’ => $vendorDir . ‘/yiisoft/yii2-redis/src’, ), ), Be careful ‘name’ => […]

  • Using docker / docker compose to deploy software applications


    Swoft The first high-performance PHP full stack framework based on swoole native orchestration in the new era, built-in orchestration network server and commonly used orchestration client, resident in memory, independent of traditional php-fpm, fully asynchronous non blocking IO implementation, similar to synchronous client writing to achieve asynchronous client use, no complex asynchronous callback, no tedious […]

  • Error type analysis of upload file printing in PHP


    In general, when using $_filesfor file upload, you can use$_FILES[“file”][“error”]To determine whether the file upload is in error.$_FILES[“file”][“error”]The corresponding error code is returned: UPLOAD_ERR_OK Its value is 0. No error occurred. The file was uploaded successfully. UPLOAD_ERR_INI_SIZE Its value is 1, and the uploaded file exceeds that in php.iniupload_max_filesize The value of the option limit. […]

  • Using swoole for system monitoring


    In general, we need to monitor a certain service of the server to make sure that the service is running normally. In general, we can use Linux to plan tasks, but the minimum execution time interval of the planned tasks is seconds, which often can not meet our requirements. At this time, the MS timer […]

  • PHP intval function Usage Summary


    Syntax: int intval ( $var, $base ) Parameters: This function takes two parameters, one of which is required and the other is optional. The parameters are as follows: $var: This is a required parameter to use as a variable that needs to be converted to an integer value. $base: it is an optional parameter that […]

  • Yii turns off debug and saves the data. An error is reported


    Today, after uploading the code to the server for testing, it was found that everything was normal, and then when debugging was turned off for testing again, an error was reported as follows: yii\base\UnknownPropertyException: Getting unknown property: front\modules\invoice\models\OrderRecord::invoice_id Finally, it is found that this is because this field is newly added by me. The Yii […]

  • The most frequent value in the PHP implementation array


    1. Write a method to realize the most frequent number in an arrayI don’t need to talk much nonsense, but I’ll go straight to the code as follows: <?php $array = [5, 2, 0, 1, 3, 1, 4]; $ar = array ﹐ count ﹐ values ($array); // the array ﹐ count ﹐ values function counts […]

  • Light PHP high performance PHP framework based on swoole


    🚀Light-phpIt is a high-performance PHP framework based on swoole, with lightweight encapsulation and ease of use, which makes it perform well in small and medium-sized high-performance projects. directory Environmental requirements Installation tutorial configuration file Route middleware Controller hook Task task WebSocket data base Pressure test Environmental requirements rely on Explain PHP >= 7.2 Recommendation 7.2 […]

  • How to generate QR code quickly in Java, python, golang and other development languages?


    There are many ways to generate free QR code! For example, the well-known forage QR code, if it’s just a simple use, it’s enough. But if you want to generate on a large scale, it’s not appropriate. Moreover, many tools are unable to add logo (like wechat QR code) to QR code. Next, I will […]