Skip to main content

Octane Support in Laravel forge 2021 5 may

 Back in March, Taylor announced the new Laravel Octane project at Laracon Online. Since then, we've been busy working on bug fixes and enhancements to Octane, as well as adding support to Laravel Forge.



Today we're pleased to announce that Octane support is available in Forge. We've written the guide below to help you get started. Please keep in mind that Octane is still in beta and should not be used in production.


Prerequisites

Your project must require "laravel/octane": "^0.3.2" or above. Your server must have PHP 8.0 installed.


You should then follow the Octane installation instructions listed in the Octane repository.


Creating an Octane Site

Octane can be enabled by selecting the Laravel Octane (Beta) project type option and PHP 8.0 as the PHP version that should be used to serve your site:


Laravel Octane Project Type

Laravel Octane Project Type


Once the project type has been selected, Forge will ask for the port that Octane should listen on.


Unlike other project types, Octane will not use PHP-FPM to serve your site. Instead, Octane starts its own RoadRunner or Swoole server (your choice) and uses Nginx as a reverse proxy to the port you select. It is wise to choose a high port number such as 8000 to prevent clashes with other software that may be running on your server.


When creating your site, Forge will install the Swoole extension if it has not already been installed on your server. All new servers that are provisioned with PHP 8.0 will automatically receive this extension.


Configuring the Octane Daemon

Once your Octane powered site has been created in Forge, you'll notice two important differences compared to a standard FPM project:


The Deploy Script does not reload PHP-FPM, instead it'll check the status of the Octane server and issue a reload command to the Octane server.

There is a new Laravel Octane (Beta) panel which displays the information you'll need to properly configure the daemon.

Forge will display the information required to create your new Daemon.

Forge will display the information required to create your new Daemon.


You should use this information to create the Daemon that will manage your Octane server. Since the Octane server is a long running process, the Daemon will monitor the process and automatically restart Octane if it crashes:


Creating a new Daemon to run Octane.

Creating a new Daemon to run Octane.


Let's quickly break down the command that Forge has generated for us:


php8.0 artisan octane:start --port=8000 --no-interaction

We ensure that octane:start runs with the PHP 8.0 binary.

We tell Octane to listen on port 8000.

We run the command with the --no-interaction option so that Octane will install any dependencies for us such as rr (the RoadRunner binary) if necessary.

Once your Daemon has been created, your Octane site should now be accessible via your web browser!


If you don’t have a Forge account, now is a great time to sign up! Forge allows you to painlessly create and manage PHP servers which include MySQL, Redis, Memcached, database backups, and everything else you need to run robust, modern Laravel applications.

Popular posts from this blog

Create Your Next Project's Readme in Laravel8 | laravelnote

  The readme.so editor gives you visual cues, starter section templates and includes many standard readme sections you're likely to use. It also has a nice preview to help guide you along the way. Never forget a section for your readme again! Select sections to add to your readme, edit the contents, and drag to rearrange. See a live-updating rendered preview of your markdown, then download your README.md file! Here's an example of starting an API section, which provides helpful formatting. You might need to specify API params: The editor includes both light and dark editor support, and you can download or copy/paste the raw markdown of your readme into version control once you're done. You can learn more about this project and start using it on  readme.so . Also, be sure to check out  readme.so on Product Hunt  and upvote it if you find it useful!

Composer Security Update (CVE-2021-29472) for leravel #2021

Composer had a security vulnerability reported (CVE-2021-29472) and a new version has been released to address this. Everyone should run  composer self-update  to get v2.0.13 which includes the fix. According to their  announcment : As a precaution after updating Composer we recommend you audit your composer.lock files to ensure they only contain URLs and none which start with -- , e.g. --config and could be considered command line options. Should you find any such URL values despite our belief that this vulnerability was not exploited in the wild, please contact us immediately by email to security@packagist.org. In general we always recommend you review changes you make to your lock files to ensure no untrusted dependencies or external URLs are introduced to your application. Please note that Packagist.org is only a metadata server and package contents are downloaded from a location chosen by the package maintainers. Private Packagist will store copies of mirrored packag...