How to Customize PHP Settings for Your Application

PHP serves as a cornerstone in driving your web applications forward. Here at kloudbean, we recognize that the default PHP configurations might not always match the specific needs of your projects. That's why we provide you with the flexibility to adjust PHP settings seamlessly within the kloudbean Platform.

This level of control becomes essential in situations such as struggling to upload large files on WordPress due to PHP's memory limit or encountering plugins that demand more resources. Our aim with this guide is to simplify the process by demonstrating how you can optimize and fine-tune PHP settings directly through our platform, eliminating the complexities of manual adjustments.

What is PHP?

What exactly is PHP? PHP, short for Hypertext Preprocessor, stands as a scripting language essential for web development. It enables the integration of dynamic functionalities into websites and facilitates server-side code processing. PHP's adaptability is instrumental in building interactive websites, ranging from personal pages to sophisticated systems like WordPress and Magento. It empowers developers to tailor settings, ensuring compatibility with a wide array of project needs.

What is the difference between PHP and PHP-FPM?

PHP and PHP-FPM (PHP-FastCGI Process Manager) are both related to PHP, but they serve different purposes in web development.

PHP:

  1. PHP (Hypertext Preprocessor) is a general-purpose scripting language primarily used for web development.
  2. It allows developers to create dynamic web pages by embedding PHP code directly into HTML.
  3. PHP is executed by the web server whenever a request is made for a PHP file. The server interprets the PHP code, processes it, and then sends the resulting HTML back to the client's browser.
  4. PHP can be run in different ways, including as a module in web servers like Apache, or as a standalone interpreter (CLI) for running scripts from the command line.

PHP-FPM:

  1. PHP-FPM (PHP FastCGI Process Manager) is a process manager for PHP that is optimized to handle high loads and improve the performance of PHP-based websites.
  2. It works with FastCGI, a protocol for interfacing interactive programs with a web server, to efficiently process PHP requests.
  3. PHP-FPM manages a pool of PHP processes, each capable of handling multiple requests, to ensure efficient resource usage and scalability.
  4. Unlike traditional PHP setups where PHP is invoked by the web server for each request, PHP-FPM keeps PHP processes running continuously, reducing the overhead of starting and stopping PHP for each request.
  5. PHP-FPM is commonly used with web servers like Nginx and Apache to handle PHP requests in a separate process pool, improving the performance and stability of PHP-based websites, especially under heavy traffic.

Step 1 — Navigate to Application Settings

Log in to your Kloudbean console using your credentials.

  1. From the top menu bar, Choose Server
  2. Next, choose the server where your desired application is deployed.

3. Click on Globe Icon and select your application

4.In the Application Administration section, click on Settings.

5. Navigate to PHP-FPM .

Step 2 — Configure PHP-FPM Settings

You can handle PHP-related configurations and instructions via the PHP settings editor, accessible from the console within the PHP Settings tab under Application Settings.

Here's an example of how to use php_flag:

php_flag[log_errors] = on

And here's an example using php_value:

php_flag[log_errors] = on

If you prefer not to utilize php.ini, .htaccess, or PHP's 'ini_set' function within your code to override PHP settings, you can use php_admin_flag and php_admin_value instead.

Was this article helpful?

How to Change the Domain Name of Your Application
How to Increase the Max Upload Size in WordPress