Mixphp V3 adds PHP FPM and cli server support

Time:2021-9-5

MixPHPV3 is mainly driven by swoole and workerman, because these two platforms have strong performance. However, most PHP developers are API developers and web programmers. Hot update may be the biggest rigid demand, so I am very interested in itVegaAn extension has been made to enable mixphp to increase the support of PHP FPM and cli server. These two modes can be used in the development environment. During online deployment, it can be switched to the swoole and workerman drivers with stronger performance.

Hard to use out of the box

PHP ecology requires many peripherals. When we develop it:

  • Swoole: swoole extension needs to be installed
  • Workerman: win does not need to be installed, MacOS needs to install pcntl, and online deployment needs to install event
  • PHP FPM: you need to install PHP FPM, nginx
  • CLI server: the only thing you don’t need to install is to start it directly on the command line with hot update

PHP-FPM

The deployment method is exactly the same as that of laravel and ThinkPHP. You can rewrite public / index.php in nginx configuration rewrite

  • Real time hot update
  • This mode is suitable for use in a development environment shared by many people
  • At the same time, if some management background development needs session, this mode can also be used
  • How to use in mixphp

CLI-Server

CLI-ServerIt is a PHP built-in web server. Because it is a single process synchronization, its performance can not be used online, but it comes with hot updates like phpfpm.

  • Real time hot update
  • Suitable for local development
  • No additional extensions are required and all platforms are compatible
  • Support static file processing without installing nginx and phpfpm
  • How to use in mixphp

CLI server mode is also supported in ThinkPHP, but ThinkPHP does not support static file processing. Mixphp does not support static file processingStatic fileIt is also supported, and there is no need to use nginx to process files.