WordPress Hosting - PHP

PHP

PHP (Hypertext Preprocessor) is an open-source scripting language that is especially suited for web development. It runs on the server side, meaning it processes code on the web server before sending it to the client (browser). WordPress is built on PHP; therefore, it’s essential for WordPress sites. PHP enables your WordPress site to:

  • Generate dynamic content and display it on a website in real time.
  • Interact with your database, allowing it to fetch and store data.
  • Handle forms and process user input, making WordPress sites more interactive.
  • Use themes and plugins to extend WordPress’s core capabilities.
  • Improve performance by ensuring much of the heavy lifting happens on the web server before the content reaches the user’s browser.

How PHP is processed

When a visitor visits an uncached page or performs an action on a page (e.g., adding something to a cart, submitting a form, etc.), the following process occurs:

  1. The web server (LiteSpeed here at Hivium) receives that request.
  2. LiteSpeed passes the request to PHP, which is assigned to an available PHP thread.
  3. The PHP thread executes the PHP script (e.g., fetching data from the database or processing forms).
  4. While processing, the PHP thread uses a portion of the server’s memory up to the PHP memory limit set by Hivium.
  5. If there are multiple concurrent visitors, each request is assigned to a different PHP thread. If all threads are busy, additional requests wait until a thread becomes available.
  6. PHP then generates an HTML page using your theme’s PHP files (and any plugin files, if applicable).
  7. PHP hands the rendered HTML page back to the web server.
  8. The page is served to the visitor.

If your site does not use caching or is not optimized, PHP threads may be busy for longer, which can degrade performance and lead to timeouts or 503 and 504 errors when visitors access your site. For information about how to check the PHP performance and how to optimize your PHP threads, refer to PHP performance.

PHP workers

PHP workers are individual PHP processes responsible for handling incoming requests to your website. Each worker processes one request at a time, meaning if you have four workers, only four requests can be processed simultaneously.

Once a PHP worker finishes processing a request (e.g., rendering a page or fetching data from a database), it becomes free to handle the next one.

PHP workers really come into play when a site doesn’t or can’t cache most of its content. The more dynamic a website is, the more PHP workers it will likely need. Cached content doesn’t require PHP workers; they’re really only needed when the site needs to query the database to get or change information. An optimized site handles requests quickly, freeing up PHP workers for the next request in the queue.

For information about how to optimize your PHP workers, refer to PHP performance.

Hivium plans and PHP workers

The following table shows the default PHP pool, thread count, and memory per thread that are included by default in each plan at Hivium:

Plan
PHP Workers per site
Memory per worker
Startup
4
512MB
Professional
6
512MB
Growth
8
512MB
Scale
10
512MB
Agency - Startup
4
512MB
Agency - Professional
6
512MB
Agency - Growth
8
512MB
Agency - Scale
10
512MB

Need more PHP Workers for your website. You can order up to 32 PHP workers per site. Contact our Sales team to know more.

PHP memory limit

The PHP memory limit defines the maximum amount of memory (RAM) each PHP worker can use while processing a request.

This limit is crucial because PHP scripts (especially in WordPress) often need to handle memory-intensive tasks such as large database queries, media uploads, or complex calculations.

If a script exceeds the set memory limit, it results in an error (e.g., “Allowed memory size exhausted”). This prevents one script from consuming excessive server resources.

Hivium plans and PHP memory

Hivium’s default memory limit is 512MB, which is more than enough for most WordPress plugins and sites. This limit exists to prevent PHP scripts from consuming excessive memory. If you set the limit too high, a misconfigured or broken script can cause serious issues by using up too much memory.

You can change a site’s PHP memory limit within Website > sitename > Advanced > Developer Tools > php.ini editor.

Interaction between PHP workers and memory

The number of PHP workers should not be confused with the PHP memory limit. PHP workers are individual PHP processes that handle incoming web requests, whereas the PHP memory limit specifies the maximum amount of memory (RAM) a single PHP script can use during execution.

PHP workers manage concurrency by processing multiple requests simultaneously, whereas the PHP memory limit manages resource allocation by restricting the memory usage of individual scripts. This prevents any single script from using all the server’s available memory.

PHP memory limits are important for scripts requiring substantial memory, such as those performing large database queries, handling large file uploads, or executing complex calculations. If you encounter memory limit errors on your site, increasing the number of PHP workers won’t resolve this issue. Instead, you should increase the memory per thread as stated above.

Interaction between PHP workers, CPU, and RAM

When adding PHP workers, CPU and RAM resources must be taken into account. If you increase the number of PHP workers, but the server needs more CPU and RAM to support those workers, this will create a bottleneck because the requests won’t be handled efficiently. If you require more PHP workers, you can connect with our Sales Team.

Default PHP values

As a Managed WordPress service, Hivium has the optimal PHP settings configured to work best with WordPress sites. If you have specific PHP requirements, feel free to reach out to our Support Team to discuss your needs.

Hivium offers PHP 7.4, 8.0, 8.1, 8.2, 8.3 and 8.4. These are the default settings for PHP:

  • memory_limit = 512M
  • post_max_size = 128M
  • upload_max_filesize = 256M
  • max_input_vars = 5000
  • max_execution_time = 60
You can customize these settings according to your requirement at Website > sitename > Advanced > Developer Tools > php.ini editor.
    • Related Articles

    • How to change the PHP version for my WordPress or WooCommerce website?

      The article will guide you on the process of how you can change the PHP version on your WordPress/WooCommerce website. 1. Once you have logged in to the control panel at https://hub.hivium.com, select the website you need to edit your PHP settings ...
    • How to use email hosting while hosting domain outside Hivium?

      The article describes the steps that you need to follow to host your email with Hivium when you are hosting your website on platforms other than Hivium like, Squarespace, Wix, Webflow, Shopfiy, etc. 1. Login to the Hivium Hub portal: ...
    • How to install WordPress via the Apps section?

      If you are looking to install WordPress with your Managed WordPress hosting account, this article will provide the steps for installation you. 1. Once you are on the Add Website page, click on the "Install An App" box. 2. Enter the domain you want to ...
    • How to transfer your website from WordPress.com to Hivium?

      Please follow the below steps that need to be followed to transfer a website from WordPress.com to Hivium's web hosting, If you're moving a WordPress site from WordPress.com, you'll need to follow special instructions to ensure you get all your ...
    • What are Hivium's nameservers?

      When updating your domain’s nameservers to point your domain to Hivium, for your WordPress or WooCommerce hosting you will need to use the following nameservers: ns1.securehostedserver.com ns2.securehostedserver.com If you have any further questions ...