Skip to main content
Webinoly provides comprehensive PHP version management, allowing you to install, configure, and switch between PHP versions seamlessly.

Supported PHP Versions

Webinoly supports the following PHP versions:

PHP 7.4

Legacy support

PHP 8.0

Active support

PHP 8.1

Active support

PHP 8.2

Active support

PHP 8.3

Active support

PHP 8.4

Default - Latest stable

PHP 8.5

Development/Preview
PHP 8.4 is set as the default version. PHP 8.5 is supported for testing and development.

Installing PHP

Default Installation

Install PHP with the default version (8.4):
sudo stack -php

Specific Version Installation

Set a specific PHP version before installation:
sudo webinoly -config-set=php-ver:8.3
sudo stack -php
If NGINX is not installed, Webinoly will prompt you to install it along with PHP.

Installed PHP Extensions

Webinoly automatically installs comprehensive PHP extensions:

Core Extensions

  • php-common - Common files for PHP
  • php-cli - Command-line interpreter
  • php-fpm - FastCGI Process Manager
  • php-opcache - Zend OPcache (PHP 5.6-8.4)
Starting with PHP 8.5, OPcache is bundled in core and cannot be installed separately.

Database Extensions

  • php-mysql - MySQL/MariaDB database support

Essential Extensions

  • php-curl - cURL support for HTTP requests
  • php-imap - IMAP email protocol support
  • php-soap - SOAP web services support

Switching PHP Versions

Webinoly makes it easy to switch between PHP versions:
1

Check Current Version

php -v
# or
sudo stack -info
2

Switch to New Version

sudo stack -php-ver=8.3
This command will:
  • Back up your current configuration
  • Remove the old PHP version
  • Install the new PHP version
  • Restore your configuration
  • Reinstall associated tools
3

Verify New Version

php -v
sudo systemctl status php8.3-fpm
Important: Switching PHP versions will:
  • Preserve your PHP configuration settings
  • Reinstall phpMyAdmin if installed
  • Reinstall Redis, Memcached, and Postfix if installed
  • May require brief downtime during the switch

PHP-FPM Configuration

Main Configuration File

PHP configuration is located at:
/etc/php/8.4/fpm/php.ini

Key PHP Settings

Webinoly optimizes PHP with the following settings:
max_execution_time = 60
max_input_vars = 5000
memory_limit = 128M

Pool Configuration

PHP-FPM pool settings:
/etc/php/8.4/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 10
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 6
pm.max_requests = 1000
Webinoly automatically calculates optimal process manager values based on your server’s available RAM.

PHP Optimization

Webinoly applies several optimizations during installation:

Memory Management

  • Memory limits automatically adjusted based on upload size
  • OPcache sized according to available RAM
  • Process pool optimized for concurrent requests

Security Hardening

1

Disable Functions

Dangerous functions can be disabled:
sudo webinoly -config-set=php-disable-functions:exec,passthru,shell_exec
2

Session Security

Sessions are secured with:
  • Strict mode enabled
  • HTTP-only cookies
  • Secure cookie flag
  • SameSite cookie policy
3

Hidden PHP Version

expose_php = Off

Performance Tuning

Control script execution timeout:
sudo webinoly -config-set=php-max-time:90
sudo stack -php -optim

Managing PHP-FPM

Service Control

sudo systemctl start php8.4-fpm

Monitoring PHP-FPM

1

Status Page

Access PHP-FPM status:
# Via admin tools site
http://your-server-ip:22222/status
2

Ping Endpoint

Test PHP-FPM availability:
http://your-server-ip:22222/ping
3

PHP Info

View complete PHP configuration:
http://your-server-ip:22222/php/

CLI Usage

PHP Command Line

# Check PHP version
php -v

# Run PHP script
php script.php

# Interactive shell
php -a

# Check loaded modules
php -m

# Check specific configuration
php -i | grep memory_limit

Advanced Configuration

Custom PHP.ini Settings

Modify PHP settings directly:
sudo nano /etc/php/8.4/fpm/php.ini

# Test and reload
sudo php-fpm8.4 -t
sudo systemctl reload php8.4-fpm

Disable Functions

For enhanced security:
disable_functions = exec,passthru,shell_exec,system,proc_open,popen

OPcache Settings

opcache.validate_timestamps = 1
opcache.revalidate_freq = 2

Session Configuration

session.gc_maxlifetime = 1440
session.cookie_lifetime = 0
session.cookie_samesite = Lax

Version-Specific Features

PHP 8.4 Features

  • Property hooks
  • Asymmetric visibility
  • Array find functions
  • PDO driver-specific SQL parsers
  • OPcache now bundled in core

PHP 8.3 Features

  • Typed class constants
  • Dynamic class constant fetch
  • json_validate() function
  • Random extension improvements

PHP 8.2 Features

  • Readonly classes
  • Disjunctive Normal Form (DNF) types
  • true, false, null as standalone types
  • Deprecate dynamic properties

Removing PHP

Complete Removal

sudo stack -php -purge
Removing PHP will also remove:
  • All PHP extensions
  • phpMyAdmin (if installed)
  • Postfix (if installed)
  • Redis PHP extension (Redis server remains)
  • Memcached PHP extension (Memcached server remains)

Troubleshooting

Check configuration and socket:
sudo php-fpm8.4 -t
ls -la /run/php/
sudo journalctl -xe
Increase PHP memory:
sudo nano /etc/php/8.4/fpm/php.ini
# Change memory_limit
sudo systemctl reload php8.4-fpm
Check both NGINX and PHP limits:
# PHP settings
php -i | grep upload_max_filesize
php -i | grep post_max_size

# NGINX setting
grep client_max_body_size /etc/nginx/nginx.conf
Manually complete the process:
sudo stack -php -purge=force
sudo webinoly -config-set=php-ver:8.3
sudo stack -php

Best Practices

Use Latest Stable

Keep PHP updated to receive security patches and performance improvements

Monitor Performance

Regularly check PHP-FPM status and adjust pool settings as needed

Optimize OPcache

Disable timestamp validation in production for maximum performance

Secure Configuration

Disable dangerous functions and enable security features

Next Steps

Install Additional Tools

Add Redis, Memcached, and more

Configure Database

Setup MySQL or MariaDB

WordPress Setup

Create WordPress sites with optimized PHP

Performance Tuning

Advanced PHP optimization techniques

Build docs developers (and LLMs) love