PHP Panel Overview 0:00When we first provision an app, web, or worker server, we are able to select one version of PHP to install on the server. However, sometimes our server may need to run multiple sites, each with their own PHP requirements. Now, we could always provision a new server, one for each version of PHP that we require, but Forge actually provides a way for us to install and manage multiple versions of PHP. Let's head over to the PHP panel on our server's dashboard, and we'll scroll down. The first thing we're shown is two forms, one for the max file upload size, and another for the max execution time. If any site on our server needs a larger max upload size, or a longer maximum execution Adjust Upload and Timeout 0:42for the max execution time. If any site on our server needs a larger max upload size, or a longer maximum execution time, we can set these settings here. And if our server is running multiple versions of PHP, these settings will be applied to all versions on our server. To set the maximum file upload size, we can simply enter 10, and this would set the setting to 10 megabytes. And then for the max execution time, we need to set the setting in seconds. Let's say 60 seconds is plenty. And there we go. Enabling Opcache 1:12Let's say 60 seconds is plenty. And there we go. Next we can manage opcache. Opcache is used to store the compiled PHP code in memory, and when it's enabled, we'll often see a greatly improved performance of our application. Now if we enable opcache, we must make sure that the deploy script is reloading the PHP FPM process. By default, Forge does include that into deploy scripts, but we should check for all the sites. And now the main feature of the PHP panel allows us to manage the versions of PHP installed on the server. Managing PHP Versions 1:41And now the main feature of the PHP panel allows us to manage the versions of PHP installed on the server. We can see that this server only has one version of PHP installed, PHP 8.1. Because of this, it's both the CLI and sites default. This means that if we were to run PHP on our server, we'd find it's running 8.1, and if we were to create any new sites through Forge, it would be configured by default with PHP 8.1 too. Every version of PHP installed on the server can be patched, which means updated to the latest minor patch version. When patching a server, there may be downtime as the PHP FPM processes would need to be Editing PHP Config Files 2:12latest minor patch version. When patching a server, there may be downtime as the PHP FPM processes would need to be restarted. So if we click on the button next to the version of PHP here, we're also able to modify a few configuration files, the PHP FPM, CLI, and the pool configurations. Each configuration does something different. The FPM settings affect the web server. We might need to edit this file if we're ever seeing a pm.maxchildren error, which is where the server is unable to spawn additional PHP processes. The CLI configuration will change how our scheduled jobs, daemons, and queues work.the server is unable to spawn additional PHP processes. The CLI configuration will change how our scheduled jobs, daemons, and queues work. It's the command line version of PHP that will be affected. And lastly, we're able to modify the PHP pools. By default, there is a pool that runs sites as the Forge user. Pools will also be created for isolated sites, which prevent other users from reading or modifying another site's files. Isolated sites are a powerful way of preventing third-party applications such as WordPress or WordPress plugins from running malicious code on our servers. If we open up one of these configuration files, we can see that Forge is showing the Installing PHP and Viewing Logs 3:10or WordPress plugins from running malicious code on our servers. If we open up one of these configuration files, we can see that Forge is showing the contents in a modal, and we're able to modify these files as needed. We're also able to install additional versions of PHP. Let's install PHP 7.4. Now this will take a few moments, and as this installs, you should know that older servers, or specifically those that are running end-of-line versions of Ubuntu, so currently that's 16.04 or below, will not be able to install additional versions of PHP. For those, you should provision a new server and move your sites to it. With PHP 7.4 installed, we can now see that we have the same settings as 8.1 had.For those, you should provision a new server and move your sites to it. With PHP 7.4 installed, we can now see that we have the same settings as 8.1 had. And if we go to create a site, we can now pick which version of PHP we want to use. Now that 7.4 is installed on our server, we're able to change the CLI default and the site's default. However, we're going to leave these as they are for now. And finally, Forge will show us the binary name of each version of PHP on the server. We can also see the log files that exist on our server. And here we can see PHP 8.1 and 7.4. If we click into any of these, Forge will load the log file for us and we're able toAnd here we can see PHP 8.1 and 7.4. If we click into any of these, Forge will load the log file for us and we're able to see the full output.