Introduce to PHP-FPM Configs in Paas.id Web Application

Introduce to PHP-FPM Configs in Paas.id Web Application

Introduction

PHP-FPM configs are two things that will control the web application performance and variables such as disabled functions, input limits, resources limits, etc.

In this guide, we will learn about PHP-FPM configs and how to manage the configs on Paas.id.

Prerequisites

  1. Have installed web server on Paas.id
  2. Have installed an web application on Paas.id

PHP Version

In Paas.id, currently we support  the PHP 7.0, 7.2, 7.4, 8.0, and 8.1. For every web application, you can use different PHP version.

FPM Config

FPM config control the performance of web application. For every web application, they can have different FPM config. Currently, Paas.id support modifying these configs:

Variables Description Values Default Values
Process Manager A process manager that control the number of child processes Static:
Since startup, {max children} child process are spawned and fixed

Ondemand:
child process are spawned and stopped based on demand

Dynamic:
child process are created dynamically based on directive {max children}, {start servers}, {min spare servers}, and {max spare servers}
Ondemand
Max Children Limiting how many child process created by process manager In unit 50
Max Requests Limiting how many request can be execute by a single child process In unit 500

PHP Config

PHP config control the variable limits of web application. For every web application, they can have different PHP config. Currently, Paas.id support modifying these configs:

Variables Description Values Default Values
Disable Functions Disabling PHP functions List of PHP functions separated by comma getmyuid,passthru,leak,listen,...
Max Execution Time Limiting max execution time of PHP scripts In second(s) 30
Max Input Time Limiting max input time to be processed by PHP In second(s) 60
Max Input Vars Limiting max input variables to be processed by PHP in single request In unit 1000
Memory Limit Limiting how many memory are used by PHP In MB 256
Post Max Size Limiting how big the request body sent to PHP In MB 256
Upload Max Filesize Limiting how big the uploaded file In MB 256
Sessions GC Maxlifetime Limiting how long a data before marked as garbage that will be clean up In second(s) 1440

Additional notes:
- Upload Max Filesize should not be greater than Post Max Size

Where I can Change the Application PHP-FPM Configs on Paas.id ?

Firstly, you need to login to Paas.id and navigate to servers page.

Paas.id servers page

On the server page, you need to open the server details page by clicking on the server where your application is located.

Paas.id server detail page

On the server detail page, you need to open the web applications page by clicking "Web Applications" menu on the left sidebar.

Paas.id web applications page

On the web applications page, you need to open the web application detail page by clicking the three dots action on web application that you want and choose "View" menu.

Paas.id web applications action menu
Paas.id web application detail page

On the web application detail page, you need to open the web application setting page by clicking "Setting" menu on the left sidebar.

Paas.id web application setting page - General section
Paas.id web application setting page - FPM setting section
Paas.id web application setting page - PHP setting section

As you can see from the image above, there is a three-section to configure the PHP-FPM configs for your web application. After changing some field, please hit the "Save Change" button and wait a minute until the changes applied.

Conclusion

At this point, you have learn what is PHP-FPM configs and how to change the configs on Paas.id. Changing PHP-FPM configs is as easy as selecting dropdown and filling value field on Paas.id web application setting page.