PHP-FPM is the default server type for PHP applications on RunCloud. It’s a fast and reliable way to run PHP scripts using a pool of processes that communicate with a web server via the FastCGI protocol. However, PHP-FPM has some limitations, such as high memory usage, slow request handling, and lack of concurrency support.
Octane Swoole is a new server type for Laravel applications on RunCloud. It’s based on Laravel Octane, a package that allows you to run your Laravel application using a high-performance server such as Swoole.
Swoole is an event-driven, co-routine-based PHP extension that provides asynchronous, non-blocking I/O, and native support for HTTP, WebSocket, TCP, and UDP protocols. By using Octane Swoole, you can improve the performance, scalability, and efficiency of your Laravel application.
The process of switching from PHP-FPM to Octane Swoole in your Laravel applications on RunCloud is super simple. After your Laravel app is up and running, you just need to follow these steps:
- SSH into your server and navigate to your application directory.
- Execute the following commands to install Octane using PHP 8.2 on your Nginx server:
/RunCloud/Packages/php82rc/bin/php /usr/sbin/composer require laravel/octane
/RunCloud/Packages/php82rc/bin/php artisan octane:install
When you’re prompted to choose between Roadrunner or Swoole, type the list number (0 or 1) corresponding to your selection and press Enter. If you’re not sure what to choose, select Swoole for a seamless installation.
- After the installation is complete, you can switch from php-fpm to Octane. Go to your RunCloud dashboard and open your web application. Click on “Octane” in the left menu, and then click “Let’s get started” to switch the server type of your application from PHP-FPM to Octane.
Note: If you can’t see the Octane entry in the left menu, make sure to switch the application type to Laravel as described in the Laravel installation instructions.
That’s it! Open your website in an incognito browser window and refresh the page a couple of times. If you don’t see an error then the Octane was installed successfully.
For more information about Octane Swoole and how to configure it, please refer to the official documentation of Laravel Octane.