Skip to content

NGINX PHP on the PaaS

Run PHP on NGINX with the Stack Harbor PaaS — FastCGI handler, HTTP/3-ready stack, and the configuration surfaces you actually need to touch.

NGINX PHP is the NGINX web server packaged as a PHP application server on the Stack Harbor PaaS. The stack uses PHP-FPM over FastCGI, so NGINX handles connections and static assets while PHP-FPM processes scripts.

Compared to Apache PHP, NGINX PHP is better at serving static content and handles a high count of concurrent connections more efficiently. FastCGI keeps it suitable for full dynamic workloads as well.

The stack is HTTP/3-ready from NGINX 1.16.1 onward for PHP 7.2.26, 7.3.13, 7.4.1 and later. To use HTTP/3 end-to-end you need a public IP — the platform’s shared load balancer does not terminate HTTP/3.

The container uses a systemd init.

Provisioning an NGINX PHP environment

  1. Click New Environment in the dashboard.
  2. In the topology wizard, open the PHP tab and pick NGINX as the application server. Set cloudlets, region, and any other parameters.
  3. Click Create.
  4. Once the environment is up, click Open in Browser next to the NGINX node — the default response is the phpinfo() page.

Configuration

Upload size is governed at the NGINX layer. To allow larger request bodies:

  1. Click Config next to the NGINX node to open the file manager.
  2. Open /etc/nginx/nginx.conf and add a directive inside the http block:
client_max_body_size 50m;
  1. Save and click Restart Nodes.

The platform’s built-in file manager has a 150MB ceiling regardless of client_max_body_size. For larger files, attach a public IP and use FTP, SFTP, or your own transfer tool.

PHP-side limits (upload_max_filesize, post_max_size) live in /etc/php.ini and need to align with client_max_body_size.

See also

  • NGINX module management on the PaaS
  • Caching on the NGINX PHP stack
  • PHP version selection and php.ini reference